Error handling - lithnet/resourcemanagement-webservice GitHub Wiki
The API returns the following response codes. Note that IIS or the WCF stack may return codes in addition to those shown here
v1 API
Code |
Description |
200 |
The operation completed successfully |
202 |
The operation completed, but is pending authorization |
400 |
The request was malformed or incomplete |
403 |
The user was not authorized to perform the operation |
404 |
The specified resource could not be found |
500 |
An internal error occurred |
The body of the response may return an ExceptionDetail object that contains details about the error that was encountered.
v2 API
Code |
Description |
200 |
The operation completed successfully |
201 |
The resource was created successfully |
202 |
The operation completed, but is pending authorization |
204 |
The operation completed successfully, and there is no content returned |
400 |
The request was malformed or incomplete |
403 |
The user was not authorized to perform the operation |
404 |
The specified resource could not be found |
500 |
An internal error occurred |
Response body
The body of the response may contain an error record that contains details about the error that was encountered. The error object is structured as follows
{
"error": {
"code": "resource-not-found",
"message": "The specified resource was not found",
"target": null,
"details": null
}
}
Field |
Description |
code |
A string-based error code. See the error code table below for supported error codes |
message |
A message indiciating the error condition |
target |
The correlation-id provided by the resource management service, if available |
details |
Reserved for future usage |
Supported error codes
Code |
Description |
bad-request |
The request was not valid |
resource-management-exception |
The request caused an exception in the resource management service |
interal-server-error |
A internal server error ocurred |
resource-not-found |
The specified resource was not found |