Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRW-2369 Added error codes. #1997

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ In addition to HTTP Status codes, Glue can return additional error codes to dist
| 1001-1099 | Guest Cart API |
| 1101-1199 | Checkout API|
| 1201-1299| Product Labels API |
| 1301-1399| Dynamic Data API |

### Data formatting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ You will receive the following error response because a non-creatable field `iso
{
"message": "Modification of immutable field `iso3_code` is prohibited.",
"status": 400,
"code": "505"
"code": "1304"
}
]
```
Expand All @@ -241,7 +241,7 @@ Otherwise, you will receive the following response:
{
"message": "Failed to persist the data. Please verify the provided data and try again. Entry is duplicated.",
"status": 400,
"code": "511"
"code": "1309"
}
]
```
Expand Down Expand Up @@ -329,7 +329,7 @@ You will receive the following error response because a non-editable field `iso3
{
"message": "Modification of immutable field `iso3_code` is prohibited.",
"status": 400,
"code": "505"
"code": "1304"
}
]
```
Expand All @@ -345,7 +345,7 @@ If `id_country` is not provided you will get the following response:
{
"message": "Incomplete Request - missing identifier.",
"status": 400,
"code": "512"
"code": "1310"
}
]
```
Expand All @@ -357,7 +357,7 @@ If `id_country` is not found you will get the following response:
{
"message": "The entity could not be found in the database.",
"status": 404,
"code": "504"
"code": "1303"
}
]
```
Expand Down Expand Up @@ -454,3 +454,20 @@ adhering to the standards outlined in the `PUT` request RFC. It's crucial to adh
to ensure accurate and consistent data manipulation during `PUT` operations.

{% endinfo_block %}

#### Error codes

Bellow you can find a list of error codes that you can receive when sending `GET`, `POST`, `PATCH` or `PUT` requests.

| Error code | Message | Description |
| --- | --- | --- |
| 1301 | Invalid or missing data format. Please ensure that the data is provided in the correct format. Example request body: `{'data':[{...},{...},..]}` | The request body is not valid. Please review the data format for validity. Ensure that the data is provided in the correct format. An example request body would be: `{'data':[{...data entity...},{...data entity...},...]}`. `data` If the data format is invalid or missing, an error message will be displayed. |
| 1302 | Failed to persist the data. Please verify the provided data and try again. | The data could not be persisted in the database. Please verify the provided data entities and try again. |
| 1303 | The entity could not be found in the database. | The requested entity could not be found in the database for retrieval or update. |
| 1304 | Modification of immutable field `field` is prohibited. | The field is prohibited from being modified. Please check the configuration for this field. |
| 1305 | Invalid data type for field: `field` | The specified field has an incorrect type. Please check the configuration for this field and correct the value. |
| 1306 | Invalid data value for field: `field`, row number: `row`. Field rules: `validation rules`. | The error indicates a data row and a field that does not comply with the validation rules in the configuration. Here is an example of the error: `Invalid data value for field: id, row number: 2. Field rules: min: 0, max: 127`. |
| 1307 | The required field must not be empty. Field: `field` | The specified field is required according to the configuration. The field was not provided. Please check the data you are sending and try again. |
| 1308 | Entity not found by identifier, and new identifier can not be persisted. Please update the request. | The entity could not be found using the provided identifier, and a new identifier cannot be persisted. Please update your request accordingly or check configuration for identifier field. |
| 1309 | Failed to persist the data. Please verify the provided data and try again. Entry is duplicated. | Failed to persist the data. Please verify the provided data and try again. This error may occur if a record with the same information already exists in the database. |
| 1310 | Incomplete Request - missing identifier. | The request is incomplete. The identifier is missing. Please check the request and try again. |