Commits

Jakub Wilk committed c785e1e

cli: improve error handling for the push command.

Comments (0)

Files changed (1)

 
 def do_push(options):
     with storage(options, save=True) as this:
-        this.push(options.date, options.text)
+        try:
+            this.push(options.date, options.text)
+        except storage_module.Duplicate as exc:
+            message = 'kajak: error: duplicate {exc}'.format(exc=exc)
+            print(message, file=sys.stderr)
 
 @contextlib.contextmanager
 def handle_match_errors(text):