> For the complete documentation index, see [llms.txt](https://docs.truecaller.com/truecaller-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truecaller.com/truecaller-sdk/android/sdk-v2.8.0-deprecating-soon/integrating-with-your-app/handling-error-scenarios.md).

# Handling Error Scenarios

**Failure/ Error responses**

The **"onFailureProfileShared"** callback method that you just implemented in the previous step helps you to handle all the possible failure cases when the user couldn't be verified successfully via the Truecaller flow.

Below are some of the possible failure scenarios and the corresponding error response that you receive for each of the cases :

| Error Code | What it means                                                                  |
| ---------- | ------------------------------------------------------------------------------ |
| 1          | Network Failure                                                                |
| 2          | User pressed back                                                              |
| 3          | Incorrect Partner Key                                                          |
| 4 & 10     | User not Verified on Truecaller\*                                              |
| 5          | Truecaller App Internal Error                                                  |
| 13         | User pressed back while verification in process                                |
| 14         | User pressed footer CTA (" USE ANOTHER NUMBER")                                |
| 15         | To handle ActivityNotFound Exception, in case Truecaller app fails to initiate |

*\***Error Type 4** and **Error Type 10** could arise in different conditions depending on whether the user has not registered on Truecaller app on their smartphone **or** if the user has deactivated their Truecaller profile at any point of time from the app.*

Apart from the above mentioned error cases, there are few other error scenarios that you may encounter under rare circumstances. For complete and exhaustive list of all the error cases, you can refer to ***TrueError.class*** within the SDK.

Please note that when you encounter any of the error scenarios and get the control in the "onFailureProfileShared()" method, you should redirect the user to your alternate verification flow.

**Exceptions**

In case you face any of the following run time exceptions, please follow the recommended steps as mentioned below :

*"No compatible client available. Please change your scope"*

As the exception suggests, you are trying to call an SDK method even though no client is available to handle it. This usually happens if you have initialised the SDK using *WITHOUT\_OTP* scope option i.e to verify only the Truecaller users, and you are not calling `isUsable()` method before calling an SDK method. To resolve this, call `isUsable()` before calling any SDK method if you are using *WITHOUT\_OTP* scope option

*"Please call init() on TruecallerSDK first"*

This exception suggests that you are trying to call an SDK method before the SDK has been initialised. To resolve it, check for all possible user flows in your app which could lead to calling an SDK method directly before it has been initiali*s*ed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.truecaller.com/truecaller-sdk/android/sdk-v2.8.0-deprecating-soon/integrating-with-your-app/handling-error-scenarios.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
