Giter Site home page Giter Site logo

Comments (4)

Michael-F-Bryan avatar Michael-F-Bryan commented on September 3, 2024 1

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.

from mdbook.

Michael-F-Bryan avatar Michael-F-Bryan commented on September 3, 2024 1

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

from mdbook.

azerupi avatar azerupi commented on September 3, 2024

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 :)

from mdbook.

Dylan-DPC-zz avatar Dylan-DPC-zz commented on September 3, 2024

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

from mdbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.