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

[RFC/WIP/DNM]: errors: Switch from anyhow to thiserror #106

Closed
wants to merge 1 commit into from
Closed

[RFC/WIP/DNM]: errors: Switch from anyhow to thiserror #106

wants to merge 1 commit into from

Conversation

jodh-intel
Copy link
Member

Convert the top level code to use concrete error type (using the thiserror crate) rather than creating errors using the anyhow crate ("all errors are strings").

Fixes: #102.

Signed-off-by: James O. D. Hunt [email protected]

@jodh-intel
Copy link
Member Author

This is a RFC/POC PR only to swithc to thiserror errors, which is designed for libraries.

Some limitations and issues:

  • I've only converted the "top-level src/ directory only.
  • I haven't converted the tests to use the new error types (so the tests will currently fail).
  • Some of the context is not maintained
    For example, in stream_processing(), we now return the error, but do not annotate it with the digest type (sha256/sha512). I could add that to all the StreamError's, but that doesn't seem like the best solution. Ideas?

wdyt @arronwy, @jiangliu?

@jodh-intel jodh-intel changed the title [RFC/WIP]: errors: Switch from anyhow to thiserror [RFC/WIP/DNM]: errors: Switch from anyhow to thiserror Jan 10, 2023
@jodh-intel
Copy link
Member Author

btw, who can I speak to about getting perms to add labels in this repo? 😄

Convert the top level code to use concrete error type
(using the `thiserror` crate) rather than creating errors using the
`anyhow` crate ("all errors are strings").

Fixes: #102.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel
Copy link
Member Author

🧱 🧱 Is there anybody... out there? 🧱 🧱

@sameo
Copy link
Member

sameo commented Feb 13, 2023

btw, who can I speak to about getting perms to add labels in this repo? 😄

You should have those perms now, @jodh-intel

Copy link
Member

@sameo sameo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @jodh-intel

@arronwy
Copy link
Member

arronwy commented Feb 21, 2023

Thanks @jodh-intel , LGTM, thanks for this enhancement!

@jodh-intel jodh-intel closed this by deleting the head repository Mar 13, 2024
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.

Switch error handling to thiserror
3 participants