Skip to content

Conversation

therustmonk
Copy link

Enhance the Error type by implementing the std::error::Error trait with the aid of the thiserror crate.

This enhancement will streamline the process of integrating this error type with various other error management strategies.

Copy link
Member

@macladson macladson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR! I agree we should implement std::error::Error however personally I think using thiserror is overkill in this situation since the error type is small and we don't have any nested errors where we need to track error sources.

We should just implement Display manually and then implement the default implementation of std::error::Error, like this:

impl std::error::Error for Error {}

It's slightly more boilerplate but it saves us a dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants