summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-03-16 18:28:26 +0200
committerLars Wirzenius <liw@liw.fi>2019-03-16 18:28:26 +0200
commit6edc972b24cb9e6922c07cc124708a8fd8680198 (patch)
tree9f0220967abf8a4eee294ebd67a041dedcb3ddb8
parent50a5e674ae97c49c1296b2b7d95e4ddaa9088776 (diff)
downloadeffitool-6edc972b24cb9e6922c07cc124708a8fd8680198.tar.gz
Add: print a nicer error message for errors
-rwxr-xr-xeffitool8
1 files changed, 6 insertions, 2 deletions
diff --git a/effitool b/effitool
index 1f4ca44..e1787a6 100755
--- a/effitool
+++ b/effitool
@@ -316,8 +316,9 @@ class Tool:
token = self.get_admin_token(server)
api = HTTPAPI(server['url'])
+ rid = args['rid']
headers = {
- 'Muck-Id': args['rid'],
+ 'Muck-Id': rid,
}
memb = api.get_json(token, '/memb', headers=headers)
@@ -426,7 +427,10 @@ def process_args(config):
args = vars(p.parse_args())
func = args['func']
- func(args)
+ try:
+ func(args)
+ except Exception as e:
+ sys.exit(str(e))
def main():