Document toolboxDocument toolbox

Standard Error Codes

The following error codes are used in the error response format throughout the application when a 4xx status is returned. Individual API calls may also add their own payloads to these responses.

JSONXML
general/cannot-process-requestA generic error response; the message should detail the
specific meaning. This is used when no reasonable
special handling by the client is possible.
general/validation-failedThe inputs provided in the request do not meet the criteria
for this API call.
general/resource-in-useThe requested shared resource is not available at this
time; the request should be tried again in a few minutes.
security/access-deniedThe requestor is currently authenticated but does not
have sufficient privileges to access the specified
resource.
security/authentication-requiredThe requestor is not currently authenticated and must
authenticate and retry the request.

Additional Payloads by Error Code

general/validation-failed: Currently, this is the only error type that will have any difference in JSON and ExtJS versions.


JSONExtJSXML
Format{
"error":
"general/validation
-failed",
"message": "<error
message>",
"fields": { <hash
of field name,
array of failure
messages> }
}
{
"success": false,
"messages":  [
<array of strings>
]
}
<?xml version="1.0"
encoding="UTF-8"?>
<response>
<error>error
code</error>
<message>error
message</message>
</response>
Example{
"error":
"general/validation
-failed",
"message": "The
policy could not be
created.",
"fields": {
short_name: ['is
already taken',
‘must be 12 or fewer
characters’], name:
'is too long'}
}
{
"success": false,
"messages":
['Short name is
already
taken','Name is too
long']
}
<?xml version="1.0"
encoding="UTF-8"?>
<response>
<error>general/validati
on-failed</error>
<message>The policy
could not be
created.</message>
<fields type="hash">
<short_name
type="array">
<item>is already
taken</item>
<item>must be 12 or
fewer characters</item>
</short_name>
<name type="array">
<item>is too
long</item>
</name>
</fields>
</response>

General/resource-in-use: The additional payload is optional for this error type; it will be included when available.


JSONXML
Format{
"error":
"general/resource-in-use"
,
"message": "<error
message>",
"model": "<model name>",
"id": <id value>,
"retry": <seconds>
}
?xml version="1.0" encoding="UTF-8"?>
<response>
<error>general/resource-in-use</error>
<message>error message</message>
<model>model name</model>
<id>id value</id>
<retry>seconds</retry>
</response>
Example{
"error":
"general/resource-in-use"
,
"message": "A job is
already running against
this device."
"model": "device",
"id": 53534634,
"retry": 60
}
<?xml version="1.0" encoding="UTF-8"?>
<response>
<error>general/resource-in-use</error>
<message>A job is already running
against this device.</message>
<model>device</model>
<id>53534634</id>
<retry>60</retry>
</response>