gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s

This commit is contained in:
2026-04-15 08:59:36 +02:00
commit ab73d05ecc
359 changed files with 14415 additions and 0 deletions

29
core/utils/exception.py Executable file
View File

@@ -0,0 +1,29 @@
from rest_framework import status
from core import exceptions
class ResponseException:
def __init__(
self,
message="",
data=None,
error_code=0,
status_code=status.HTTP_400_BAD_REQUEST,
exception=None,
**kwargs
):
if isinstance(exception, exceptions.BreakException):
raise exception
if data is None:
data = []
response = {
"success": False,
"message": message,
"data": data,
"error_code": error_code,
**kwargs,
}
raise exceptions.MyApiException(response, status_code)