3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

ServiceBot: display custom error messages for NotAuthenticatedError

This commit is contained in:
James Lu 2016-08-25 00:41:53 -07:00
parent 945818e1d8
commit 7d2b22630d

View File

@ -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)))