gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
40
core/exceptions/core.py
Executable file
40
core/exceptions/core.py
Executable file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
Raise exception
|
||||
"""
|
||||
|
||||
from rest_framework import exceptions
|
||||
|
||||
|
||||
class SmsException(Exception):
|
||||
"""
|
||||
Sms exception
|
||||
"""
|
||||
|
||||
def __init__(self, message, **kwargs):
|
||||
super().__init__(message)
|
||||
self.kwargs = kwargs
|
||||
|
||||
|
||||
class BreakException(Exception):
|
||||
"""
|
||||
Break exception
|
||||
"""
|
||||
|
||||
def __init__(self, *args, message: str = None, data=None):
|
||||
if data is None:
|
||||
data = []
|
||||
self.args = args
|
||||
self.message = message
|
||||
self.data = data
|
||||
|
||||
|
||||
class MyApiException(exceptions.APIException):
|
||||
"""
|
||||
My API Exception for API exceptions status code edit
|
||||
"""
|
||||
|
||||
status_code = 400
|
||||
|
||||
def __init__(self, message, status_code):
|
||||
super().__init__(message)
|
||||
self.status_code = status_code
|
||||
Reference in New Issue
Block a user