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:
parent
6bcb9e1e7c
commit
4b0c8ae0be
2 changed files with 18 additions and 1 deletions
12
lodel/auth/exceptions.py
Normal file
12
lodel/auth/exceptions.py
Normal 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)
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue