summaryrefslogtreecommitdiff
path: root/server/szurubooru/errors.py
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2016-04-02 13:13:40 +0200
committerrr- <rr-@sakuya.pl>2016-04-02 14:19:01 +0200
commit769ef8f14118872d7da7d515c4e358e705ebe312 (patch)
tree3574650f14411a6cb6238f78648b829b305488ee /server/szurubooru/errors.py
parent06cf8c79d4c255e3f69f1c282ebe81139ac3727a (diff)
server/general: move errors to top level NS
Diffstat (limited to 'server/szurubooru/errors.py')
-rw-r--r--server/szurubooru/errors.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/szurubooru/errors.py b/server/szurubooru/errors.py
new file mode 100644
index 0000000..01be594
--- /dev/null
+++ b/server/szurubooru/errors.py
@@ -0,0 +1,10 @@
+''' Exports custom errors. '''
+
+class AuthError(RuntimeError):
+ ''' Generic authentication error '''
+
+class IntegrityError(RuntimeError):
+ ''' Database integrity error (e.g. trying to edit nonexisting resource) '''
+
+class ValidationError(RuntimeError):
+ ''' Validation error (e.g. trying to create user with invalid name) '''