Error handling

All the functions with callbacks mentioned in the previous sections have success and failure callbacks, the failure callback returns a custom error relevant to the function, this custom error can be used to show an error or an action that can be taken based on the returned error.

All of the following errors are of type FunnelConnectError that inherits Throwable.

Showing errors flagged from the SDK to the end user is not recommended. Errors are returned so some custom action can be taken by developers based on the error type.

The following are all the errors that are expected to be returned.

Error Description
HttpException Denotes an HTTP exception with an error message and a status code.
NoInternetConnectionException Denotes that the internet is not reachable through wifi or cellular.
If wifi or cellular is connected but no internet connection this error won’t be thrown.
SdkAlreadyInitializedException This error will be thrown on an attempt to initialize the SDK after it has already been initialized.
SdkTokenCanNotBeEmptyException This error will be thrown if you pass an empty token to the SDK’s initializer.
SdkNotInitializedException This error will be thrown if you try to access any function from the SDK before/without initializing the SDK.
InvalidSdkTokenException Denotes an invalid token is used to initialize the SDK.
ConfigFileNotFound Denotes that SDK config is not found.
InfoNotEnabledException Denotes that Info is not enabled and it should be enabled or not used.
TrackingNotEnabledException Denotes that Tracking is not enabled and it should be enabled or not used.
IdentificationNotEnabledException Denotes that Identification is not enabled and it should be enabled or not used (Start the FunnelConnect service as a guest user).
GenericException Denotes a general error that is not one of the errors in this table.
UnknownException Denotes an unknown error.