# 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.
