From 7d2b22630d8059dfb7e47dd6216599ed23e12017 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 25 Aug 2016 00:41:53 -0700 Subject: [PATCH] ServiceBot: display custom error messages for NotAuthenticatedError --- utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index b2ca733..21b54cc 100644 --- a/utils.py +++ b/utils.py @@ -266,8 +266,8 @@ class ServiceBot(): for func in self.commands[cmd]: try: func(irc, source, cmd_args) - except NotAuthenticatedError: - self.reply(irc, 'Error: You are not authorized to perform this operation.') + except NotAuthenticatedError as e: + self.reply(irc, 'Error: Not authorized. %s' % e) except Exception as e: log.exception('Unhandled exception caught in command %r', cmd) self.reply(irc, 'Uncaught exception in command %r: %s: %s' % (cmd, type(e).__name__, str(e)))