chroma-core / chroma-core/chroma
[Feature Request]: Return detailed JSON in HTTP API errors
- Dominant language
- Rust
- Stars
- 29.3k
- Forks
- 2.5k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 38
Description
### Describe the problem
The HTTP API returns an "error" that needs to be parsed to extract anything valuable.
### Describe the proposed solution
Instead, return a detailed JSON with fields for error message, code, detail, and potentially even a recommendation for a solution.
### Alternatives considered
_No response_
### Importance
would make my life easier
### Additional Information
```
$ curl http://localhost:8000/api/v1/collections/foobar -v
* Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /api/v1/collections/foobar HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< date: Thu, 27 Jul 2023 19:34:19 GMT
< server: uvicorn
< content-length: 59
< content-type: application/json
<
* Connection #0 to host localhost left intact
{"error":"ValueError('Collection foobar does not exist.')"}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing GET /api/v1/collections/foobar with the curl example and inspect the current JSON error response. Define the detailed error contract around message, code, detail, and any recommendation, then verify that the API returns those fields consistently for this failure case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100