Created
May 10, 2022 15:54
-
-
Save Joaopcamposs/54d8b1f04b0b18537d76b501a6ecec7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exceptions.py | |
class UserException(Exception): | |
... | |
class UserNotFoundError(UserException): | |
def __init__(self): | |
self.status_code = 404 | |
self.detail = "User Not Found" | |
class UserAlreadyExistError(UserException): | |
def __init__(self): | |
self.status_code = 409 | |
self.detail = "User Already Exists" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment