3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

ServiceBot: log access denials to warning - closes #593

(backported from commit 655221491c)
This commit is contained in:
James Lu 2018-04-07 20:21:41 -07:00
parent d0568a6ad7
commit 7476c6cf05

View File

@ -350,7 +350,11 @@ class ServiceBot():
for func in self.commands[cmd]:
try:
func(irc, source, cmd_args)
except (NotAuthorizedError, InvalidArgumentsError) as e:
except NotAuthorizedError as e:
self.reply(irc, 'Error: %s' % e)
log.warning('(%s) Denying access to command %r for %s; msg: %s', irc.name, cmd,
irc.getHostmask(source), e)
except InvalidArgumentsError as e:
self.reply(irc, 'Error: %s' % e)
except Exception as e:
log.exception('Unhandled exception caught in command %r', cmd)