Skip to content

Conversation

@IAmConorNolan
Copy link
Contributor

Summary

Improves error messages returned from updateUser on iOS by including detailed diagnostic information.

Changes

  • Enhanced error messages to include error code, domain, and description
  • Added underlying error details when available
  • Error object now includes detailedMessage, errorCode, errorDomain, and underlying error information

Before/After

Before:

Error in updateUser

After:

updateUser failed with error code -1012: Response body is empty for HTTP 200. Domain: io.intercom.ios.error.network

Safety

  • Purely additive change - no breaking changes
  • Preserves all original error properties (code, domain, userInfo)
  • Maintains NSNull safety through existing removeNullUnderlyingError method
  • Guards against NSNull when extracting underlying error details

Testing

Tested with intercepted network requests returning various error conditions:

  • Empty response body
  • Invalid JSON
  • Valid responses

Error messages now provide actionable debugging information.

Improve error messages returned from updateUser by including:
- Error code and domain for easier debugging
- Descriptive error message with context
- Underlying error details when available

This change is purely additive - it preserves all original error properties
and maintains NSNull safety through removeNullUnderlyingError.

Before: "Error in updateUser"
After: "updateUser failed with error code -1012: Response body is empty for HTTP 200. Domain: io.intercom.ios.error.network"
@IAmConorNolan
Copy link
Contributor Author

Closing this PR. On reflection, the existing error handling is sufficient - detailed error information is already available in the error object (error.userInfo, error.domain, error.code) for integrators who need it. Promoting this to the error message string could inadvertently expose PII in logging tools like Sentry, which typically auto-capture error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants