From e6e173b74d381f590ff5a8e7957489ea4d50c06b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Sat, 28 Jan 2023 03:13:28 +0300 Subject: auth: Store error_code in Exception for flexibility To allow for different error codes for the various exceptions, store the error_code in the exception objects and retrieve it from there when generating the response. --- gn3/auth/authorisation/errors.py | 1 + 1 file changed, 1 insertion(+) (limited to 'gn3/auth/authorisation') diff --git a/gn3/auth/authorisation/errors.py b/gn3/auth/authorisation/errors.py index fa2d6b7..89c5983 100644 --- a/gn3/auth/authorisation/errors.py +++ b/gn3/auth/authorisation/errors.py @@ -6,6 +6,7 @@ class AuthorisationError(Exception): All exceptions in this package should inherit from this class. """ + error_code: int = 500 class UserRegistrationError(AuthorisationError): """Raised whenever a user registration fails""" -- cgit v1.2.3