utils: allow changing APIError attributes (#38721)
This commit is contained in:
parent
ef12d99049
commit
47805fc808
|
@ -31,11 +31,11 @@ CALLBACK_NAME = getattr(settings, 'JSONRESPONSE_CALLBACK_NAME', 'callback')
|
|||
|
||||
class APIError(RuntimeError):
|
||||
'''Exception to raise when there is a remote application or business logic error.'''
|
||||
err = 1
|
||||
log_error = False
|
||||
http_status = 200
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.err = kwargs.pop('err', 1)
|
||||
self.log_error = kwargs.pop('log_error', False)
|
||||
self.http_status = kwargs.pop('http_status', 200)
|
||||
self.__dict__.update(kwargs)
|
||||
super(APIError, self).__init__(*args)
|
||||
|
||||
|
|
Loading…
Reference in New Issue