From: Ian Weller Date: Wed, 2 Feb 2011 20:35:50 +0000 (-0600) Subject: [commit] Fix ugly traceback on permissiondenied X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/68c68ed8ee4dc61fd44791ec974daa983c604ead [commit] Fix ugly traceback on permissiondenied --- 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 - ' \