Добавление портфолио в тестовом виде

This commit is contained in:
2023-04-04 23:35:51 +03:00
parent f200ec0bef
commit 9982c3b529
4 changed files with 122 additions and 13 deletions

View File

@@ -74,16 +74,14 @@ def __make_error(ex: Exception):
def make_error_object(ex: Exception | list):
try:
data = {
"status": "error"
}
if type(ex) == list:
data["error"] = {
"status": "error",
"error": {
"code": API_ERROR_MULTIPLY_ERRORS[0],
"message": API_ERROR_MULTIPLY_ERRORS[1],
}
} if type(ex) == list else __make_error(ex)
}
if type(ex) == list:
data["related"] = [__make_error(e) for e in ex]
else:
data["error"] = __make_error(ex)
return data
except BaseException as err: