Use a more fitting error type
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue names no files or tests; start by locating the crate's anyhow return types and APIs that return tonic::Status. Inventory any other returned errors before choosing between a wrapper and an enum. Done means an agreed public error design with matching, conversion, and user-facing behavior covered.
Written by the indexing model from the issue text.
Description
Currently this crate uses anyhow, which is usually meant for applications, not libraries. This makes it very hard to match on an error, because the error is essentially opaque. As far as I can see, we mostly return ´tonic::Status`, but there may be some APIs that also can return other errors.
The classic way of dealing with this is create a newtype that wraps Status, has a From<Status> impl and allows basically the same functionality (especially matching on Code). We could also create an enum instead, but I should note that this will either make the implementation, the user interface or both needlessly complex. If we have API calls that can return other errors, either have them return their own specific error type or convert whatever error we get to our predefined error type internally.
Another way would be to make the error type opaque, but that has the downside of making it harder for users to implement From<QdrantError> for their own error types, essentially requiring a Box or other indirection.
- Dominant language
- Rust
- Stars
- 425
- Forks
- 89
- Avg merge
- 2h 48m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/rust-client
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
qdrant/rust-client#320 ·
-
upsert_points deep-clones the whole request on every call, not only on retryMay be free again @NullSense claimed this 7 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
qdrant/rust-client#316 · 3 comments ·
-
Option to set TLS domain name and :authority origin (client behind a tunnel/proxy)May be free again @inamdarmihir claimed this 37 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
qdrant/rust-client#306 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 38/100
qdrant/rust-client#289 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
qdrant/rust-client#272 · 2 reactions ·
All issues in qdrant/rust-client
Similar issues
-
autofix:working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
libracoder/kiri#1138 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
roc-lang/basic-webserver#277 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
samkerrcode/opengent#113 ·
Maintainers usually reply within 1 day
-
app bug session
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day