aboutsummaryrefslogtreecommitdiff
path: root/server/szurubooru/services/errors.py
diff options
context:
space:
mode:
authorrr-2016-04-02 10:01:27 +0200
committerrr-2016-04-02 10:02:20 +0200
commit06cf8c79d4c255e3f69f1c282ebe81139ac3727a (patch)
tree1a074acc83d132dc491c8f8f36641e6f050c3f9e /server/szurubooru/services/errors.py
parentd3d2540b8871968a5adb6bb35fe2795d3116503b (diff)
server/api: move validation to service layer
Diffstat (limited to 'server/szurubooru/services/errors.py')
-rw-r--r--server/szurubooru/services/errors.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/szurubooru/services/errors.py b/server/szurubooru/services/errors.py
index 09fbe51..01be594 100644
--- a/server/szurubooru/services/errors.py
+++ b/server/szurubooru/services/errors.py
@@ -2,8 +2,9 @@
class AuthError(RuntimeError):
''' Generic authentication error '''
- pass
class IntegrityError(RuntimeError):
- ''' Database integrity error '''
- pass
+ ''' Database integrity error (e.g. trying to edit nonexisting resource) '''
+
+class ValidationError(RuntimeError):
+ ''' Validation error (e.g. trying to create user with invalid name) '''

© 2015 - 2026 Jakob L. Kreuze