mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-20 07:20:59 +01:00
ServiceBot: display custom error messages for NotAuthenticatedError
This commit is contained in:
parent
945818e1d8
commit
7d2b22630d
4
utils.py
4
utils.py
@ -266,8 +266,8 @@ class ServiceBot():
|
|||||||
for func in self.commands[cmd]:
|
for func in self.commands[cmd]:
|
||||||
try:
|
try:
|
||||||
func(irc, source, cmd_args)
|
func(irc, source, cmd_args)
|
||||||
except NotAuthenticatedError:
|
except NotAuthenticatedError as e:
|
||||||
self.reply(irc, 'Error: You are not authorized to perform this operation.')
|
self.reply(irc, 'Error: Not authorized. %s' % e)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception('Unhandled exception caught in command %r', cmd)
|
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)))
|
self.reply(irc, 'Uncaught exception in command %r: %s: %s' % (cmd, type(e).__name__, str(e)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user