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 error handling #28

Open
dbrgn opened this issue Mar 12, 2016 · 7 comments
Open

Improve error handling #28

dbrgn opened this issue Mar 12, 2016 · 7 comments
Assignees
Milestone

Comments

@dbrgn
Copy link
Collaborator

dbrgn commented Mar 12, 2016

Go over errors, handle them consistently, don't use unwrap.

Regarding the error macro, we should probably switch to https://github.com/tailhook/quick-error.

@dbrgn dbrgn added this to the Version 0.3.0 milestone Mar 14, 2016
@dns2utf8 dns2utf8 modified the milestones: Version 0.3.0, 0.4.0 Sep 1, 2016
@rnestler
Copy link
Member

Maybe we should switch to https://docs.rs/error-chain/0.10.0/error_chain/

@g5pw
Copy link
Collaborator

g5pw commented Jul 17, 2019

So, I'd like to try and tackle this one, maybe using failure as mentioned in #67

@dbrgn
Copy link
Collaborator Author

dbrgn commented Jul 17, 2019

@g5pw great, I assigned you!

I'm a bit unsure about failure. It has a few advantages, but also a few disadvantages. But those mostly affect libraries.

Since spaceapi-server-rs is mostly used directly by the end user, I think it would be fine though. @g5pw if you want you can take a closer look at what failure offers and what advantages and disadvantages are. Maybe error-chain would also still be a good option, it would allow us to chain errors from the spaceapi-rs and spaceapi-server-rs crates.

Another option would be to just keep using quick-error, but to create a custom error enum for all types of errors that can happen in this crate.

@g5pw
Copy link
Collaborator

g5pw commented Jul 17, 2019

Hm, from a quick look it looked like failure crate would be the successor of error-chain, but apparently that's not the case. I'll try to look more into it in these days :)

@g5pw
Copy link
Collaborator

g5pw commented Aug 2, 2019

I though about this for a while and read both intros, it looks like error_chain has a simpler api than failure. I'll try porting to that and see how it goes :)

@rnestler
Copy link
Member

Looking at it now I'd prefer to use https://crates.io/crates/thiserror since we already use it in https://github.com/spaceapi-community/spaceapi-rs

@dbrgn
Copy link
Collaborator Author

dbrgn commented Nov 23, 2022

Both error_chain and failure should not be used anymore. In general I recommend thiserror for libraries and anyhow for applications.

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

4 participants