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

Switch to thiserror or similar #115

Open
expede opened this issue Jul 12, 2023 · 2 comments
Open

Switch to thiserror or similar #115

expede opened this issue Jul 12, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@expede
Copy link
Member

expede commented Jul 12, 2023

NB: Feature requests will only be considered if they solve a pain or present a useful refactoring of the code.

Summary

Problem

rs-ucan today doesn't provide descriptive errors

Impact

It's hard to debug when integrating rs-ucan into applicatons, and makes it difficult to provide good error messages to users.

Solution

Switch from anyhow to thiserror or similar. The general guidance ([even metioned in the anyhow README) is that anyhow is great for applciations (where you don't expect to recover the error), and thiserror is best for libraries because it gives you more detail about what went wrong.

The trade off is that thiserror involves more manual threading through of error structs.

Detail

@blaine ran into this while building the Fission server.

Coda

First off, thank you so much to the miantainers of rs-ucan for the work thus far. anyhow was probably the fastest & most pragmatic way to get things running.

@cdata
Copy link
Member

cdata commented Jul 13, 2023

Sounds good to me, contributions welcome here!

@cdata cdata added the enhancement New feature or request label Jul 13, 2023
@cdata
Copy link
Member

cdata commented Jul 13, 2023

Anecdotally, we use thiserror in Noosphere (so soft preference for that crate)

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

No branches or pull requests

3 participants