Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 typeFfiConverterTypeGenericError
. ThisGenericErrorType
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 ⚔️
libXMTP
and the XMTP iOS SDK. The included protocol and protocol ExtensionGenericErrorDescribing
serves a reusable foundation for addressing these hybrid error types in future pull requests.Discussion 🎙
The protocol and subsequent protocol extension
GenericErrorDescibing
is included to enable extending error handling for errors thrown via additional call sites tolibXMTP
where the error type thrown is ofFfiConverterTypeGenericError
. Adopting theGenericErrorDescribing
protocol will catch all instances of the enum and generate the string descriptions that are passed.