Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Error Handling #277

Merged
merged 1 commit into from
Mar 6, 2024
Merged

Improved Error Handling #277

merged 1 commit into from
Mar 6, 2024

Conversation

zombieobject
Copy link
Contributor

@zombieobject zombieobject commented Mar 6, 2024

Introduction 📟

Currently when errors from libXMTP are surfaced to consumers and integrators of the XMTP iOS SDK, they lack enough information about the specific nature of the error being thrown.

Purpose ℹ️

This pull request is intended to surfaces errors thrown via call sites from libXMTP that throw the error type FfiConverterTypeGenericError. This GenericErrorType always contains a string message that provides additional detail about the nature of the error being thrown.

This also address the following issue Improve Client Facing Errors

Scope 🔭

  • ApiClient
  • ApieClientError
  • GenericErrorDescribing

Out of Scope ⚔️

  • Error Localization
  • Pretty User Facing Errors
  • Additional error types that include a hybrid of error messages from both libXMTP and the XMTP iOS SDK. The included protocol and protocol Extension GenericErrorDescribing serves a reusable foundation for addressing these hybrid error types in future pull requests.
  • SDK Version Increment & Release - This will occur in a subsequent pull request once coordination on any additional features to be included has completed.

Discussion 🎙

The protocol and subsequent protocol extension GenericErrorDescibing is included to enable extending error handling for errors thrown via additional call sites to libXMTP where the error type thrown is of FfiConverterTypeGenericError. Adopting the GenericErrorDescribing protocol will catch all instances of the enum and generate the string descriptions that are passed.

This PR is intended to surfaces errors thrown via call sites from LibXMTP that throw FfiConverterTypeGenericError.
@zombieobject zombieobject added the enhancement New feature or request label Mar 6, 2024
@zombieobject zombieobject self-assigned this Mar 6, 2024
@zombieobject zombieobject marked this pull request as ready for review March 6, 2024 21:10
@zombieobject zombieobject requested a review from a team as a code owner March 6, 2024 21:10
@zombieobject zombieobject enabled auto-merge (squash) March 6, 2024 21:11
@zombieobject zombieobject merged commit f5182b0 into main Mar 6, 2024
2 checks passed
@zombieobject zombieobject deleted the em/improved-error-handling branch March 6, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants