Browse Source

Adding more exceptions

Yann Weber 8 years ago
parent
commit
4b0c8ae0be
2 changed files with 18 additions and 1 deletions
  1. 12
    0
      lodel/auth/exceptions.py
  2. 6
    1
      lodel/exceptions.py

+ 12
- 0
lodel/auth/exceptions.py View File

@@ -0,0 +1,12 @@
1
+from lodel import logger
2
+
3
+def AuthenticationError(Exception):
4
+    pass
5
+
6
+def AuthenticationFailure(Exception):
7
+    
8
+    def __init__(self, client):
9
+        msg = "%s : authentication failure" % client
10
+        logger.security(msg)
11
+        super().__init__(msg)
12
+

+ 6
- 1
lodel/exceptions.py View File

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

Loading…
Cancel
Save