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

Improve Errors using miette #103

Merged
merged 60 commits into from
Oct 13, 2023
Merged

Improve Errors using miette #103

merged 60 commits into from
Oct 13, 2023

Conversation

asmello
Copy link
Contributor

@asmello asmello commented Oct 6, 2023

The primary goal of this PR is to implement some error reporting improvements developed for #95 while avoiding introducing new public types.

What's different from #95

Instead of introducing typed errors everywhere, I made judicious use of them only for error reusability (so that structurally similar errors need only be defined once).

This approach preserves the current pattern of defining opaque errors inline and leaking eyre::Report as the crate's external error type. It does not introduce any new public error types.

src/command.rs Outdated Show resolved Hide resolved
src/command.rs Outdated Show resolved Hide resolved
src/command.rs Outdated Show resolved Hide resolved
src/package.rs Outdated Show resolved Hide resolved
src/package.rs Outdated Show resolved Hide resolved
src/package.rs Outdated Show resolved Hide resolved
src/registry/local.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@mara-schulke mara-schulke left a comment

Choose a reason for hiding this comment

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

I dislike the fact that this mr does things way beyond its scope, its a bit hard to review.

The error side looks good to me mostly! Just the refactoring of existing code makes changes hard to track and bloats this. Could you eventually split refactoring the registries etc in a second pr, based on this one and revert the changes for now so we can merge this today?

Mostly lgtm! 😊

@asmello asmello merged commit 55f9abf into main Oct 13, 2023
@asmello asmello deleted the amello/alternative branch October 13, 2023 12:12
@asmello asmello mentioned this pull request Oct 13, 2023
This was referenced Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity::high Issues or ideas that are highly complex. require discussion and may affect backwards compatibility component::cli Everything related to the buffrs cli datamodel Changes related to the Datamodel priority::high Urgent change or idea, please review quickly type::idea Rough idea or proposal for buffrs type::refactoring Changing the inner-workings of buffrs type::style Related to personal or community opinions
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants