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

Propagating errors instead of panicking #597

Merged
merged 2 commits into from
Feb 3, 2025
Merged

Conversation

jonathanhamel4
Copy link
Contributor

@jonathanhamel4 jonathanhamel4 commented Jan 29, 2025

Propagating errors instead of panicking. (Usage of expect will panic, but map_err or ok_or will not and return proper results)

Copy link
Contributor

@adampetro adampetro left a comment

Choose a reason for hiding this comment

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

Have you tested how much adding anyhow affects the resulting binary size?

If it does have an impact on binary size, I think this is possible to do without anyhow, just using shopify_function::Result and static strings as the errors. example

@jonathanhamel4
Copy link
Contributor Author

Have you tested how much adding anyhow affects the resulting binary size?

If it does have an impact on binary size, I think this is possible to do without anyhow, just using shopify_function::Result and static strings as the errors. example

Good feedback. I've made changes to not include anyhow then 👍 .

@jonathanhamel4 jonathanhamel4 changed the title using anyhow to propagate errors instead of panicking Propagating errors instead of panicking Jan 29, 2025
@jonathanhamel4 jonathanhamel4 merged commit 7afda8a into main Feb 3, 2025
4 checks passed
@jonathanhamel4 jonathanhamel4 deleted the jh/small-changes-fn branch February 3, 2025 13:47
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