diff options
| author | Frederick Muriuki Muriithi | 2026-08-26 14:07:40 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2026-08-26 14:13:36 -0500 |
| commit | 607ba9f68e8c810a713196da1b9ef33c90ce6a3c (patch) | |
| tree | 78d5a056bc63822aad633943b23a62636e19cdc0 | |
| parent | 13119ccaa6de82076c384d7d83618e390f9b8e05 (diff) | |
| download | gn-auth-607ba9f68e8c810a713196da1b9ef33c90ce6a3c.tar.gz | |
Fix error codes for various input validation errors.
| -rw-r--r-- | gn_auth/auth/errors.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |
