summaryrefslogtreecommitdiff
path: root/examples/wire.py
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2016-02-21 11:30:36 +0100
committerMatthias Geier <Matthias.Geier@gmail.com>2016-02-21 11:30:36 +0100
commit6eef105e2592542746c56c02c64c5afa7050ee71 (patch)
treec635fe3429c7485a55febf2b3fe714f322606b26 /examples/wire.py
parent6e86b42f6f4974083f643fa9160a12579e34f46c (diff)
DOC: Use the same exception handling strategy in all examples
Diffstat (limited to 'examples/wire.py')
-rwxr-xr-xexamples/wire.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/wire.py b/examples/wire.py
index 6acdeb1..7ee4000 100755
--- a/examples/wire.py
+++ b/examples/wire.py
@@ -39,6 +39,7 @@ try:
if callback_status:
logging.warning(str(callback_status))
-except BaseException as e:
- # This avoids printing the traceback, especially if Ctrl-C is used.
- raise SystemExit(str(e))
+except KeyboardInterrupt:
+ parser.exit('\nInterrupted by user')
+except Exception as e:
+ parser.exit(type(e).__name__ + ': ' + str(e))