All errors should be trapped by an exception and return a standard error object, which is translated into the correct output format by ApiOpenStudio.
example (json):
{
"error": {
"id": "example_function_id",
"code": 7,
"message": "The application does not exist."
}
}
example (xml):
<error>
<id>example_function_id</id>
<code>7</code>
<message>The application does not exist</message>
</error>
Where possible, HTML status codes will also match the above error codes, which
will usually be a 200 (Success) or 400 (Bad Request)