Skip to content

Add ErrorMapper protocol for registering custom error mappers #35

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

Merged
merged 3 commits into from
May 3, 2025

Conversation

Jeehut
Copy link
Member

@Jeehut Jeehut commented May 3, 2025

Fixes #27.

Proposed Changes

  • This adds a new ErrorMapper protocol, which also is now used by the custom mapping extensions.
  • A new function ErrorKit.registerMapper(_:) is used to register custom mappers, such as for 3rd-party libs.
  • The documentation was appropriately updated to mention custom error mapping capabilities.

@Jeehut Jeehut merged commit 2c1aa89 into main May 3, 2025
1 check passed
@Jeehut Jeehut deleted the wip/error-mapper branch May 3, 2025 06:14
@Jeehut Jeehut mentioned this pull request May 3, 2025
@Sherlouk
Copy link

Sherlouk commented May 3, 2025

this is perfect.

@Jeehut
Copy link
Member Author

Jeehut commented May 3, 2025

@Sherlouk Thanks for the idea! This just made a lot of sense. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add custom error mapping
2 participants