Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Error Handling FAQ #50

Open
Open
@yaahc

Description

@yaahc

Reducing confusion around error handling in the rust-lang ecosystem is one of the top priorities for the error handling project group this year. As part of that effort we're going to start maintaining a list of Frequently Asked Questions about error handling.

For now this issue will serve as a living document for these FAQs, though eventually I hope to move them to a move permanent / visible location.

Unanswered Questions

If you have any questions that aren't covered by this list, or if you feel any of the answers here fail to completely answer their question for you please let us know so we can improve this list. You can follow up the following ways:

Frequently Asked Questions

When should I use panic! vs Result?

Proposed Questions

How should I structure my error types?

TODO (complex and situational)

My current plan is to do a series of case studies on user codebases in various domains. If you have a codebase that you think would be a good candidate for a case study, either because you feel it has optimal error handling that should be used as an ideal example or because it needs improvement, please reach out so I can add you to the list of potential candidates.

  • Requirements:
    • must be able and willing to test nightly or experimental features when relevant, e.g. generic member access, try traits, error in panic, etc (tho you don't need to be willing to commit changes to master or anything)
    • maintainers must have time to spare to provide feedback at multiple stages of the case study

There are many different error handling libraries in use, such as quick-error, error-chain, failure, snafu, thiserror, anyhow, and eyre. [I'm just listing those in the order in which I think they were released.] How do they differ? What different use-cases do they target?

TODO

  • update error handling library section in awesome-rust, cross link to it, provide a framing around "types of error handling" that libraries provide support for (e.g. error defining vs error reporting) and tag the libraries in awesome-rust with the types of error handling they support.
  • Possibly also link to relevant categories on crates.io and lib.rs for further looking up available error handling libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions