Error handling in the REST Management API
- Last Updated: June 6, 2018
- 1 minute read
- Corticon
- Documentation
Error handling
Error handling is done through HTTP error codes and appropriate error objects.
Error Objects
A failed API call will place an object in the entity similar to this:
{
"error"
{"type" : The java type of the exception that was thrown to generate this error,
"parentError" : The nested error object that was the cause of thisexception
(This field is included only when this error has a nested error),
"message" : The message from this error code,
"stackTrace" : This array contains lines of a stacktrace, each will correspond
to a stackframe or an exception label if there are nested exceptions
[...]
}
}
Common error behavior
All REST urls defined have a common error behavior. An error response returned by the server consists of two parts:
- A HTTP status code other than 200.
- A JSON Object in the response payload containing the error property.
Common HTTP status codes
The server can return following codes:
200 OKThe request was processed successfully.400 Bad requestAn incorrect request.500 Internal Server ErrorThe server encountered an error while processing the request.