]> git.ipfire.org Git - location/libloc.git/blobdiff - src/python/location.in
location: Print proper error message for any uncaught exceptions
[location/libloc.git] / 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)