16 lines
441 B
Python
16 lines
441 B
Python
from django.utils.translation import gettext_lazy as _
|
|
from rest_framework import exceptions, status
|
|
|
|
|
|
class SerivceError(exceptions.APIException):
|
|
"""Service error."""
|
|
status_code = status.HTTP_503_SERVICE_UNAVAILABLE
|
|
default_detail = _('Service is temporarily unavailable')
|
|
|
|
def __init__(self, data=None):
|
|
if data:
|
|
self.default_detail = {
|
|
**data
|
|
}
|
|
super().__init__()
|