From 9b94ec57c504acb6ef815d134144c4c357c71f17 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 8 Feb 2023 17:24:35 +0300 Subject: auth: groups: handle join requests. --- gn3/auth/authorisation/errors.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gn3/auth/authorisation/errors.py') diff --git a/gn3/auth/authorisation/errors.py b/gn3/auth/authorisation/errors.py index e1fb1a0..99ee55d 100644 --- a/gn3/auth/authorisation/errors.py +++ b/gn3/auth/authorisation/errors.py @@ -6,7 +6,7 @@ class AuthorisationError(Exception): All exceptions in this package should inherit from this class. """ - error_code: int = 500 + error_code: int = 400 class UserRegistrationError(AuthorisationError): """Raised whenever a user registration fails""" @@ -14,3 +14,9 @@ class UserRegistrationError(AuthorisationError): class NotFoundError(AuthorisationError): """Raised whenever we try fetching (a/an) object(s) that do(es) not exist.""" error_code: int = 404 + +class InconsistencyError(AuthorisationError): + """ + Exception raised due to data inconsistencies + """ + error_code: int = 500 -- cgit v1.2.3