From 68c68ed8ee4dc61fd44791ec974daa983c604ead Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Wed, 2 Feb 2011 14:35:50 -0600 Subject: [PATCH] [commit] Fix ugly traceback on permissiondenied --- src/mw/clicommands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 0fa122a..7acfba2 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -305,6 +305,11 @@ class CommitCommand(CommandBase): if self.options.bot: data['bot'] = 'bot' response = self.api.call(data) + if 'error' in response: + if 'code' in response['error']: + if response['error']['code'] == 'permissiondenied': + print 'Permission denied -- try running "mw login"' + return if response['edit']['result'] == 'Success': if 'nochange' in response['edit']: print 'warning: no changes detected in %s - ' \ -- 2.39.5