mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-26 04:04:22 +01:00
coreplugin: catch NotAuthenticatedError in a prettier way
This commit is contained in:
parent
fe0156551a
commit
2c4a88b9be
@ -32,10 +32,11 @@ def handle_commands(irc, source, command, args):
|
|||||||
for func in world.bot_commands[cmd]:
|
for func in world.bot_commands[cmd]:
|
||||||
try:
|
try:
|
||||||
func(irc, source, cmd_args)
|
func(irc, source, cmd_args)
|
||||||
|
except utils.NotAuthenticatedError:
|
||||||
|
utils.msg(irc, source, 'Error: You are not authorized to perform this operation.')
|
||||||
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)
|
||||||
utils.msg(irc, source, 'Uncaught exception in command %r: %s: %s' % (cmd, type(e).__name__, str(e)))
|
utils.msg(irc, source, 'Uncaught exception in command %r: %s: %s' % (cmd, type(e).__name__, str(e)))
|
||||||
return
|
|
||||||
utils.add_hook(handle_commands, 'PRIVMSG')
|
utils.add_hook(handle_commands, 'PRIVMSG')
|
||||||
|
|
||||||
# Handle WHOIS queries, for IRCds that send them across servers (charybdis, UnrealIRCd; NOT InspIRCd).
|
# Handle WHOIS queries, for IRCds that send them across servers (charybdis, UnrealIRCd; NOT InspIRCd).
|
||||||
|
Loading…
Reference in New Issue
Block a user