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

[Discussion] Add solid Error messages #14

Closed
azerupi opened this issue Jul 29, 2015 · 4 comments
Closed

[Discussion] Add solid Error messages #14

azerupi opened this issue Jul 29, 2015 · 4 comments
Labels
A-CLI Area: CLI C-enhancement Category: Enhancement or feature request C-papercut Category: A small usability bug M-Discussion Meta: Discussion S-Wishlist Status: Wishlist

Comments

@azerupi
Copy link
Contributor

azerupi commented Jul 29, 2015

When using the cli tool there should be solid error messages explaining exactly what went wrong, if it is a parsing error add line numbers, ...

Non-fatal errors should not cause mdBook to stop. They should be stored and reported at the end.

How can this be done? What would be a good design?

Inspiration

azerupi added a commit that referenced this issue Aug 11, 2015
… The unwraps where replaced with more diverse error messages #14
@azerupi azerupi added this to the 0.1.0 milestone Jan 21, 2016
@azerupi azerupi added M-Discussion Meta: Discussion and removed Status: On hold labels Aug 12, 2016
@azerupi azerupi changed the title Add solid Error messages [Discussion] Add solid Error messages Aug 12, 2016
@azerupi azerupi removed this from the 0.1.0 milestone Nov 3, 2016
@azerupi azerupi added A-CLI Area: CLI S-Wishlist Status: Wishlist C-enhancement Category: Enhancement or feature request C-papercut Category: A small usability bug and removed Type: Clean-up labels May 16, 2017
@Michael-F-Bryan
Copy link
Contributor

Michael-F-Bryan commented Jun 24, 2017

It looks like error-chain is quickly becoming the de-facto tool for doing good error handling. In particular, the rust cookbook is pushing it as the way to do error handling in all examples.

Would it be a good idea to switch to using error-chain instead of std::io::Error or Box<Error> everywhere? I feel like the chain_err() method in particular would help with returning a nice human-readable message to the user, while still retaining all the information necessary to help with debugging.

Coupling error-chain with more robust algorithms (e.g. trying fallbacks when an operation returns an Err instead of erroring out) would probably greatly improve the error handling story for mdbook.

@azerupi
Copy link
Contributor Author

azerupi commented Jun 24, 2017

Yes, error-chain was already pulled in as a dependency for the build script to 'test out'. I haven't had the time yet to catch up with what error-chain can do, but I've heard a lot of good. So I'm ok to start using it pervasively throughout the code base :)

@Dylan-DPC-zz
Copy link

Closing this issue due to inactivity. If needed we can discuss this in an new issue. Thanks

@Michael-F-Bryan
Copy link
Contributor

Thanks @Dylan-DPC. I think we should have closed the issue after merging #361.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI C-enhancement Category: Enhancement or feature request C-papercut Category: A small usability bug M-Discussion Meta: Discussion S-Wishlist Status: Wishlist
Projects
None yet
Development

No branches or pull requests

3 participants