Skip to content

Use thiserror instead of anyhow for DisconnectReason::ByError #104

Description

@vladbat00

It would be great to be able to match by an error type without the need to downcast errors from anyhow::Error.

Atm, it's impossible to know the range of possible errors in DisconnectReason::ByError, which makes it difficult for users to make an informed decision on what they should handle or not.
It's also a better practice for libraries to expose errors as matchable enums, whereas anyhow is advised to be used only in applications or private modules when users don't care about specific error types.

A similar issue was originally opened in lightyear, as it inherits the same problem of being unable to match by exact error type, and then also exaggerates it by casting anyhow::Error to a string via debug-printing cBournhonesque/lightyear#1704. But to fix the problem altogether in lightyear, I hope this issue can also be addressed on the aeronet end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions