How to do error handling when SDK does not expose custom errors? | Community
Skip to main content

How to do error handling when SDK does not expose custom errors?

  • August 15, 2025
  • 1 reply
  • 0 views

Andrew46

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?

1 reply

Hi Andrew,
 
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?