Errors
Error format, common error codes, and example error responses.
- An error representation contains a list of errors. This is useful when more than 1 error is detected such as a list of validation errors.
- In production, debug information such as stacktrace, exception type and message aren't emitted for security and brevity.
Properties
| Name | Description |
|---|---|
| id | An optional id used to track the source of the error. |
| code | A code that is used to identify the error. |
| message | A user friendly string explaining the error. |
| exceptionMessage | A technical explanation of the error. |
| exceptionType | The type of error. |
| stackTrace | The error stack trace. |
Common Errors
400Bad Request401Unauthorized403Forbidden404Not Found500Internal Server Error503Service Unavailable
Examples
Production
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"errors": [
{
"code": 4002,
"message": "Unable to locate a theatre with an id of 23.",
}
]
}
Development
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8
{
"errors": [
{
"id": "C79E7D2F-CEE2-434D-9620-13F428EB941D",
"code": 4002,
"message": "Unable to communicate with a downstream system.",
"exceptionMessage": "An error has occurred.",
"exceptionType": "AMC.Ecommerce.Domain.Exceptions.ServiceException",
"stackTrace": "..."
}
]
}