feat(core): Add custom exception class

ref: #248 #373
This commit is contained in:
2024-10-31 22:30:00 +09:30
parent a75a56eb96
commit 821ba0edbf
2 changed files with 20 additions and 4 deletions

View File

@ -1,5 +1,20 @@
from rest_framework import exceptions, status
from rest_framework.exceptions import (
ValidationError,
PermissionDenied
)
class MissingAttribute(Exception):
""" An attribute is missing"""
pass
pass
class APIError(
exceptions.APIException
):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = 'An unknown ERROR occured'
default_code = 'unknown_error'