Skip to content

Error handling overhaul #1675

Open
Open
@UMR1352

Description

@UMR1352

Description

Rework all of our crates' error types and handling techniques. Avoid the use of a single big enum-based error type per crate or module and instead model errors for each unit of fallibility. Make sure to implement std::error::Error::source whenever possible as well as annotating stuff with #[non_exaustive] to allow for the extensibility of our error types.

Motivation

The current error handling state in our crates is downright bad, error messages are of little use, the types most of the times don't have any additional information useful for recovering from them, sources are almost never used.

Resources

Here's a blog post that describes in details how error handling should be done for a library.

UMR1352's note: This is simply my opinion, if other maintainers have any other suggestion or comment on this approach, let's discuss it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking changeA change to the API that requires a major release. Part of "Changed" section in changelogChoreTedious, typically non-functional changeRustRelated to the core Rust code. Becomes part of the Rust changelog.WasmRelated to Wasm bindings. Becomes part of the Wasm changelog

    Type

    Projects

    Status

    Product Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions