Fastapi refactor update
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
from http import HTTPStatus
|
||||
|
||||
|
||||
class CustomException(Exception):
|
||||
code = HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
error_code = HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
message = HTTPStatus.INTERNAL_SERVER_ERROR.description
|
||||
|
||||
def __init__(self, message=None):
|
||||
if message:
|
||||
self.message = message
|
||||
|
||||
|
||||
class UnauthorizedException(CustomException):
|
||||
code = HTTPStatus.UNAUTHORIZED
|
||||
error_code = HTTPStatus.UNAUTHORIZED
|
||||
message = HTTPStatus.UNAUTHORIZED.description
|
||||
from http import HTTPStatus
|
||||
|
||||
|
||||
class CustomException(Exception):
|
||||
code = HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
error_code = HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
message = HTTPStatus.INTERNAL_SERVER_ERROR.description
|
||||
|
||||
def __init__(self, message=None):
|
||||
if message:
|
||||
self.message = message
|
||||
|
||||
|
||||
class UnauthorizedException(CustomException):
|
||||
code = HTTPStatus.UNAUTHORIZED
|
||||
error_code = HTTPStatus.UNAUTHORIZED
|
||||
message = HTTPStatus.UNAUTHORIZED.description
|
||||
|
||||
Reference in New Issue
Block a user