From 607ba9f68e8c810a713196da1b9ef33c90ce6a3c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 26 Aug 2026 14:07:40 -0500 Subject: Fix error codes for various input validation errors. --- gn_auth/auth/errors.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gn_auth/auth/errors.py') diff --git a/gn_auth/auth/errors.py b/gn_auth/auth/errors.py index c499e86..832d1bd 100644 --- a/gn_auth/auth/errors.py +++ b/gn_auth/auth/errors.py @@ -14,6 +14,7 @@ class ForbiddenAccess(AuthorisationError): class UserRegistrationError(AuthorisationError): """Raised whenever a user registration fails""" + error_code: int = 400 class UserVerificationError(UserRegistrationError): """Raised when verification of a user fails.""" @@ -26,6 +27,7 @@ class InvalidData(AuthorisationError): """ Exception if user requests invalid data """ + error_code: int = 400 class InconsistencyError(AuthorisationError): """ @@ -37,8 +39,10 @@ class PasswordError(AuthorisationError): """ Raise in case of an error with passwords. """ + error_code: int = 400 class UsernameError(AuthorisationError): """ Raise in case of an error with a user's name. """ + error_code: int = 400 -- cgit 1.4.1