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

Error handling #12

Open
flying-sheep opened this issue Nov 14, 2019 · 4 comments
Open

Error handling #12

flying-sheep opened this issue Nov 14, 2019 · 4 comments

Comments

@flying-sheep
Copy link
Owner

We probably want to switch to more concrete errors once the dust settles. Candidates:

  • thiserror (if we want discernible structs)
  • anyhow (if we just need user-displayable errors)
@getreu
Copy link

getreu commented Nov 14, 2020

For a library like yours I would suggest thiserror.
From the web page:

Use thiserror if you care about designing your own dedicated error type(s) so that the caller receives exactly the information that you choose in the event of failure. This most often applies to library-like code. Use Anyhow if you don't care what error type your functions return, you just want it to be easy. This is common in application-like code.

@flying-sheep
Copy link
Owner Author

Yup, I think so too!

@oovm
Copy link

oovm commented Dec 20, 2021

The Error needs re-export or I can't impl From from this error

@getreu
Copy link

getreu commented Jun 13, 2022

Failure is officially deprecated/unmaintained

See output of cargo audit below.

Please consider migrating to an alternative, e.g. thiserror is widely used and maintained.

Crate:     failure
Version:   0.1.8
Warning:   unmaintained
Title:     failure is officially deprecated/unmaintained
Date:      2020-05-02
ID:        RUSTSEC-2020-0036
URL:       https://rustsec.org/advisories/RUSTSEC-2020-0036
Dependency tree:
failure 0.1.8
├── rst_renderer 0.4.0
│   └── tp-note 1.17.0
├── rst_parser 0.4.0
│   └── tp-note 1.17.0
└── document_tree 0.4.0
    ├── rst_renderer 0.4.0
    └── rst_parser 0.4.0

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

No branches or pull requests

3 participants