Files
centurion_erp/app/core/exceptions.py

22 lines
414 B
Python

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