# Error handling

It is possible that a REST API request may result in an error.

* You must always check for error or \_error in the response and if the value is Y, then you can conclude that the API has resulted in an error.
* You must check for errorTitle and errorMessage for the reason for the failure. If the failure is due to the expired *sessionId* passed, then *sessionExpired* will be set to Y.
* For debugging, you can check the corresponding sqlCall for the SQL query that caused the exception, and the corresponding datasource call for the datasource that caused the exception.
* If the client user is an administrator, then an additional attribute *adminMsg* is populated with a more detailed error message.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudio.io/creating-datasources/working-with-datasources/accessing-data-sources-using-rest-api/error-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
