Error Structure
Learn about the structure of errors returned by the API.
We are using the Auction House endpoints in these examples. The error structure is the same for all endpoints.
The error structure
Prop | Type | Default |
---|---|---|
errors | Array<object> | - |
errors[].code? | string | - |
errors[].message | string | - |
errors[].path? | Array<string> | - |
status | string | - |
statusCode | number | - |
Examples
Imagine you're trying to get a listing by its ID, but that listing doesn't exist. You will get the following error:
In the above example, the errors
property is an array of errors. In this case, there is only one error. The status
property is the HTTP status, and the statusCode
property is the HTTP status code number.
If the error is a validation error, we will return a more detailed error message. For example, if you try to delete an Auction House listing and the ID is not a valid listing ID (UUID), you will get the following error:
In the above example, the code
property is the error code, the message
property is the error message, and the path
property is the path to the property that caused the error. In this case, the id
property caused the error.
As an example, you will receive the following error if you are not using the new Media model when adding images to the listing:
Error Codes
For an explanation of the different response codes and what they mean, see HTTP Status Codes.