mirror of
https://github.com/xhongc/music-tag-web.git
synced 2026-02-13 23:25:14 +08:00
19 lines
837 B
Python
19 lines
837 B
Python
# -*- coding: utf-8 -*-
|
|
from component.utils.exceptions import (AuthenticationError, NotAuthenticatedError,
|
|
PermissionDeniedError, MethodNotAllowedError,
|
|
NotAcceptableError, UnsupportedMediaTypeError,
|
|
ThrottledError, ParamValidationError, ResourceNotFound)
|
|
|
|
# drf exception to blueapps exception
|
|
exception_mapping = {
|
|
"ValidationError": ParamValidationError,
|
|
"AuthenticationFailed": AuthenticationError,
|
|
"NotAuthenticated": NotAuthenticatedError,
|
|
"PermissionDenied": PermissionDeniedError,
|
|
"NotFound": ResourceNotFound,
|
|
"MethodNotAllowed": MethodNotAllowedError,
|
|
"NotAcceptable": NotAcceptableError,
|
|
"UnsupportedMediaType": UnsupportedMediaTypeError,
|
|
"Throttled": ThrottledError
|
|
}
|