pwsafe: Don't produce a backtrace on decryption failure.
[catacomb-python] / pwsafe
diff --git a/pwsafe b/pwsafe
index 91684c7..043db43 100644 (file)
--- a/pwsafe
+++ b/pwsafe
@@ -276,8 +276,11 @@ if argv[0] in commands:
   argv = argv[1:]
 else:
   c = 'find'
-if commands[c][0](argv):
-  print >>stderr, 'Usage: %s %s %s' % (prog, c, commands[c][1])
-  exit(1)
+try:
+  if commands[c][0](argv):
+    print >>stderr, 'Usage: %s %s %s' % (prog, c, commands[c][1])
+    exit(1)
+except DecryptError:
+  die("decryption failure")
 
 ###----- That's all, folks --------------------------------------------------