1
0
mirror of https://github.com/etesync/server synced 2024-11-19 07:18:08 +00:00
etesync-server/django_etebase/exceptions.py

13 lines
354 B
Python
Raw Normal View History

from rest_framework import serializers, status
class EtebaseValidationError(serializers.ValidationError):
def __init__(self, code, detail, status_code=status.HTTP_400_BAD_REQUEST):
super().__init__(
2020-12-01 10:45:23 +00:00
{
"code": code,
"detail": detail,
}
)
self.status_code = status_code