Closed jgrund closed 2 years ago
@jgrund, thanks for the suggestion. I believe this would be a good enhancement.
A first version of this implementation can be found in the develop
branch. Maybe you can have a quick look and see if this suits your use case.
Hi,
Thanks for addressing this.
I tried out the latest develop branch, but got a compilation error trying to use Database
within a tokio::spawn
.
This is because UpstreamError
is wrapped in Rc
, which is not Send
, and also because inner type is not Send
+ Sync
.
I'll open a PR to fix
Changes have been released as part of couch_rs v0.9.0
It's not easy to tell if a
CouchError
originated from something like a failure to Deserialize or some other cause. This is becauseCouchError
is a struct rather than an enum and multiple items all get the same status:https://github.com/mibes/couch-rs/blob/f15ba8b79c8d9a3fb218e3f20a4762ea55967db6/couch_rs/src/error.rs#L74-L102
Consider making
CouchError
an enum so downstream consumers can match over the Error types and not have to resort to string matching on message.