1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-11-26 07:16:54 +01:00

Adding more exceptions

This commit is contained in:
Yann 2016-07-07 15:32:06 +02:00
commit 4b0c8ae0be
2 changed files with 18 additions and 1 deletions

12
lodel/auth/exceptions.py Normal file
View file

@ -0,0 +1,12 @@
from lodel import logger
def AuthenticationError(Exception):
pass
def AuthenticationFailure(Exception):
def __init__(self, client):
msg = "%s : authentication failure" % client
logger.security(msg)
super().__init__(msg)

View file

@ -3,7 +3,6 @@
class LodelException(Exception):
pass
class LodelExceptions(LodelException):
##@brief Instanciate a new exceptions handling multiple exceptions
# @param msg str : Exception message
@ -25,3 +24,9 @@ class LodelExceptions(LodelException):
expt_msg=str(expt)
)
return msg
##@brief Designed to be a non catched exception.
#
#@note Designed to be raised in dramatic case
class LodelFatalError(Exception):
pass