To help you handle errors and special cases, the Script Debugger API returns HTTP status codes and faults.
The following table lists the HTTP status codes and their typical use cases:
HTTP status code | Cases |
---|---|
200 (OK) | GET or POST request successfully completed. |
201 (Created) | POST request successfully created a new resource. |
204 (No Content) | DELETE, HEAD, or OPTIONS (or less typically a POST) request successfully completed and returned no content. |
400 (Bad Request) | Request contains invalid information, such as malformed parameters, malformed header values, or a malformed body. |
401 (Unauthorized) | Request is not authorized to be processed. |
403 (Forbidden) | Request is declined by the server. |
404 (Not Found) | Requested resource does not exist. |
405 (Method Not Allowed) | Resource does not support supplied HTTP method. |
412 (Precondition Failed) | PATCH request provided an outdated last-known base point, which means the resource was changed on server, possibly by a concurrent request. |
415 (Unsupported Media Type) | Media type specified in "format" request parameter (or Accept header) is not supported. |
500 (Internal Server Error) | Request cannot be fulfilled because of an unexpected condition on the server. |
For status codes greater than or equal to 400, the API returns a fault document:
{
"_v":"2.0",
"type":"ScriptThreadNotFoundException",
"message":"Could not find Script Thread for identifier '1'."
}
The fault document contains a type identifier and a readable message.