Skip to content

Improve error handling ergonomics for call#39

Merged
abs0luty merged 1 commit intoprogramatik29:masterfrom
Ademan:wip-better-call
Nov 14, 2025
Merged

Improve error handling ergonomics for call#39
abs0luty merged 1 commit intoprogramatik29:masterfrom
Ademan:wip-better-call

Conversation

@Ademan
Copy link
Copy Markdown
Contributor

@Ademan Ademan commented Nov 16, 2024

This change I think it improves the ergonomics of handling custom errors significantly.

From the tests you can see that it's fairly unintrusive overall, it eliminates the need for lots of .map_err(|e| e.into())s and eliminates the need for downcasting the Error::Other variant, as well as consolidating Error::Rusqlite and Error::Other into Error::Error which is generic.

In particular look at test_ergonomic_errors to see how it improves error ergonomics.

I understand if it's too big of a change though.

@abs0luty abs0luty marked this pull request as ready for review November 14, 2025 13:37
@abs0luty abs0luty self-requested a review as a code owner November 14, 2025 13:37
@abs0luty
Copy link
Copy Markdown
Collaborator

abs0luty commented Nov 14, 2025

@Ademan No worries, I think it's perfectly fine.

@abs0luty abs0luty merged commit c399769 into programatik29:master Nov 14, 2025
Copy link
Copy Markdown
Collaborator

@abs0luty abs0luty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

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.

2 participants