You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the Error type from tendermint_rpc in an error type of my own using thiserror and would like to derive PartialEq on my error type, but this is currently not possible since the tendermint_rpc Error does not implement PartialEq. It does have a derive attribute for PartialEq, but according to the doc comments in flex_error these are not added to the main error struct. So either flex_error needs to be updated to implement PartialEq for all error types created with the define_error! macro, or PartialEq needs to be specifically implemented for the tendermint_rpc Error.
Definition of "done"
PartialEq is implemented for rpc::Error.
The text was updated successfully, but these errors were encountered:
Submit PR upstream to add the PartialEq instances to the error types in tendermint_rpc.
Manually implement PartialEq in your error type by inspecting into the error detail.
Use alternative approaches to check for error equality. The common use case of error equality is to check whether an error returned in tests is the same as expected. This can be done with a match on the error detail. The matching can be simplified with helper methods such as defined here.
Note that as errors can be wrapped in many ways, a simple equality check may sometimes not be sufficient to check on whether two errors are "equals". A simple way to think of it is that you could for example get an IoError from a network access or a file access. However the IoError may be wrapped in different sub-errors such as NetworkError or FileError. So you need to look at the error definitions to figure out whether there are multiple sources of the error of interest.
Description
I'm trying to use the Error type from tendermint_rpc in an error type of my own using
thiserror
and would like to derive PartialEq on my error type, but this is currently not possible since the tendermint_rpc Error does not implement PartialEq. It does have a derive attribute for PartialEq, but according to the doc comments in flex_error these are not added to the main error struct. So either flex_error needs to be updated to implement PartialEq for all error types created with thedefine_error!
macro, or PartialEq needs to be specifically implemented for the tendermint_rpc Error.Definition of "done"
PartialEq is implemented for rpc::Error.
The text was updated successfully, but these errors were encountered: