Список кодов ошибок.
Каждая из ошибок содержит обязательные поля code и message, означающие
Код ошибки и Сообщение соответственно. Некоторе ошибки имеют дополнительную информацию.
Например, JsonInvalidSyntax ошибка имеет поле pos, которое показывает позицию, где ошибка синтаксиса
json документа.
Код ошибки | HTTP статус код | Сообщение | Пример ошибки |
---|---|---|---|
ClientAccountExists | 302 | Клиент аккаунта уже есть |
{ "code": "ClientAccountExists", "message": "Client account exists", "extraInfo": null } |
ClientAccountNotFound | 404 | Клиент аккаунта не найден |
{ "code": "ClientAccountNotFound", "message": "Client account not found", "extraInfo": null } |
ClientNotFound | 404 | Клиент не найден |
{ "code": "ClientNotFound", "message": "Client not found", "extraInfo": null } |
FirmNotFound | 404 | Фирма не найдена |
{ "code": "FirmNotFound", "message": "Firm not found", "extraInfo": null } |
Forbidden | 403 | Доступ запрещен |
{ "code": "Forbidden", "message": "Access forbidden", "extraInfo": null } |
InternalServerError | 500 | Внутренняя ошибка сервера |
{ "code": "InternalServerError", "message": "Internal server error", "extraInfo": null } |
InvalidJson (некорректный синтаксис) | 400 | Некорректный входной json |
{ "code": "InvalidJson", "message": "Invalid json", "extraInfo": { "syntaxErrorPos": 18 } } |
InvalidJson (некорректный тип поля) | 400 | Некорректный входной json |
{ "code": "InvalidJson", "message": "Invalid json", "extraInfo": { "fieldMustBeType": "int64", "fieldValue": "number 9090.9" } } |
InvalidPathParam | 400 | Некорректный параметр в path |
{ "code": "InvalidPathParam", "message": "Invalid path param", "extraInfo": { "param": "id" } } |
InvalidQueryParam | 400 | Некорректный параметр в параметрах запроса |
{ "code": "InvalidQueryParam", "message": "Invalid query param", "extraInfo": { "name": "fio", "": null } } |
InvoiceNotFound | 500 | Инвойс не найден |
{ "code": "InvoiceNotFound", "message": "Invoice not found", "extraInfo": null } |
NotFound | 404 | Ресурс не найден |
{ "code": "NotFound", "message": "Resource not found", "extraInfo": null } |
Ok | 200 | Запрос выполнен успешно |
{ "code": "Ok", "message": "Sucess", "extraInfo": null } |
OversizedForRegion | 400 | Превышен лимит для краевой доставки |
{ "code": "OversizedForRegion", "message": "Oversized for region", "extraInfo": null } |
PasswordTooShort | 400 | Пароль слишком короткий |
{ "code": "PasswordTooShort", "message": "password too short", "extraInfo": null } |
PriceNotFound | 404 | Прайс не найден |
{ "code": "PriceNotFound", "message": "price not found", "extraInfo": null } |
RequiredAtLeastOne | 400 | По крайней мере один из параметров - обязательный |
{ "code": "RequiredAtLeastOne", "message": "At least one parameter is required", "extraInfo": { "params": [ "phone", "email" ] } } |
RequiredParams | 400 | Все перечисленные параметры - обязательные |
{ "code": "RequiredParams", "message": "Required params", "extraInfo": { "params": [ "weight", "width", "height", "length" ] } } |
SendingNotFound | 404 | Накладная не найдена |
{ "code": "SendingNotFound", "message": "Sending not found", "extraInfo": null } |
SessionExpired | 401 | Сессия истекла |
{ "code": "SessionExpired", "message": "Session: expired. Your session was expired. Please login", "extraInfo": null } |
SessionNotBelongUser | 401 | Неправильная сессия |
{ "code": "SessionNotBelongUser", "message": "session does not belong to this account", "extraInfo": null } |
SessionNotFound | 401 | Сессия не найдена |
{ "code": "SessionNotFound", "message": "Session: not found. You are not logged in", "extraInfo": null } |
TooManyRequests | 429 | Слишком много запросов |
{ "code": "TooManyRequests", "message": "Too many requests", "extraInfo": null } |
Unauthorized | 401 | Неавторизованный доступ |
{ "code": "Unauthorized", "message": "Unauthorized access", "extraInfo": null } |
ValueAlreadySet | 400 | Значание уже было сохранено в БД |
{ "code": "ValueAlreadySet", "message": "Value is already set", "extraInfo": null } |
WrongDevKey | 401 | Неправильный токен приложения |
{ "code": "WrongDevKey", "message": "Wrong or empty development key", "extraInfo": null } |