]> git.ipfire.org Git - location/libloc.git/commitdiff
location: Print proper error message for any uncaught exceptions
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Mar 2022 10:50:34 +0000 (10:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Mar 2022 10:50:34 +0000 (10:50 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location.in

index 10269468be95dd99d9a67d3ec6e787dfc421f2dc..eec32e4ca966c8973be32d40d086557fce177ef7 100644 (file)
@@ -238,6 +238,11 @@ class CLI(object):
                        sys.stderr.write("%s\n" % e)
                        ret = 2
 
+               # Catch any other exceptions
+               except Exception as e:
+                       sys.stderr.write("%s\n" % e)
+                       ret = 1
+
                # Return with exit code
                if ret:
                        sys.exit(ret)