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 NSError with code and message.

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 Code Description
HttpException HTTP Codes Denotes an HTTP exception with an error message and a status code.
InvalidSdkTokenException -1982 Denotes an invalid token is used to initialize the SDK.
SdkAlreadyInitializedException -1983 This error will be thrown on an attempt to initialize the SDK after it has already been initialized.
NoInternetConnectionException -1984 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.
ConfigFileNotFound -1985 Denotes that SDK config is not found.
SdkTokenCanNotBeEmptyException -1986 This error will be thrown if you try to pass an empty token to the SDK’s initializer.
SdkNotInitializedException -1987 This error will be thrown if you try to access any function from the SDK before/without initializing the SDK.
InfoNotEnabledException -1992 Denotes that Info is not enabled and it should be enabled or not used.
TrackingNotEnabledException -1993 Denotes that Tracking is not enabled and it should be enabled or not used.
IdentificationNotEnabledException -1994 Denotes that Identification is not enabled and it should be enabled or not used (Start the FunnelConnect service as a guest user).
GenericException -1981 Denotes a general error that is not one of the errors in this table.
UnknownException -1990 Denotes an unknown error.