When there is no network connection, ZendeskSDK throws something like this:
ZendeskSDK.ZendeskError.failedToInitialize(error: Optional(ZendeskSDKHTTPClient.HTTPError.requestFailed(error: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=
As you can see, this is a custom error containing another custom error which in turn contains an underlying error. The problem – these errors are not exposed by the sdk, meaning that developers are not able to write code which would check, for example, if the issue was caused by the network error or something else.
1) Why would Zendesk developers not expose errors to developers? This is literally the first time I see anything like this in the SDK
2) How on earth are we supposed to parse these?
How to do error handling when SDK does not expose custom errors?
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
In general, the SDK has events that you can listen for and log, including a connection status change event that may provide more context. Specific to your failure to initialize error, are you seeing this consistently in your testing? Or in logging?