diff --git a/classes.py b/classes.py index 91f7204..bb9acd2 100644 --- a/classes.py +++ b/classes.py @@ -953,13 +953,13 @@ class Irc(): def checkAuthenticated(self, uid, allowAuthed=True, allowOper=True): """ Checks whether the given user has operator status on PyLink, raising - NotAuthenticatedError and logging the access denial if not. + NotAuthorizedError and logging the access denial if not. """ lastfunc = inspect.stack()[1][3] if not self.isOper(uid, allowAuthed=allowAuthed, allowOper=allowOper): log.warning('(%s) Access denied for %s calling %r', self.name, self.getHostmask(uid), lastfunc) - raise utils.NotAuthenticatedError("You are not authenticated!") + raise utils.NotAuthorizedError("You are not authenticated!") return True def matchHost(self, glob, target, ip=True, realhost=True): diff --git a/utils.py b/utils.py index 21b54cc..a7e4476 100644 --- a/utils.py +++ b/utils.py @@ -16,7 +16,7 @@ from . import world, conf # This is just so protocols and plugins are importable. from pylinkirc import protocols, plugins -class NotAuthenticatedError(Exception): +class NotAuthorizedError(Exception): """ Exception raised by checkAuthenticated() when a user fails authentication requirements. @@ -266,7 +266,7 @@ class ServiceBot(): for func in self.commands[cmd]: try: func(irc, source, cmd_args) - except NotAuthenticatedError as e: + except NotAuthorizedError as e: self.reply(irc, 'Error: Not authorized. %s' % e) except Exception as e: log.exception('Unhandled exception caught in command %r', cmd)