influxdata / influxdata/influxdb
Not found errors from the catalog should indicate which resource was not found
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
### Problem
When an action is taken against the catalog, e.g., `influxdb3 create trigger`, for a resource that does not exist in the catalog, the error returned is very opaque. It just says `the requested resource was not found`.
### Proposed solution
The type of resource should be reported as `the requested was not found`, e.g.,
```
the requested database was not found
```
We could potentially extend this with the requested resource name as `the requested named was not found`, e.g.,
```
the requested database named foo was not found
```
### Additional context
The variant that produces this error is here: https://github.com/influxdata/influxdb/blob/959555ab22cd7ad980c69c67c69d0fc2846f1e1d/influxdb3_catalog/src/error.rs#L19-L20
This could be updated to accept a `&'static str` for the resource type, and potentially a `String` for the resource name, so that where it is reported, e.g., here: https://github.com/influxdata/influxdb/blob/959555ab22cd7ad980c69c67c69d0fc2846f1e1d/influxdb3_catalog/src/catalog/update.rs#L204-L206
We can include the resource type and name.
Contributor guide
Research direction
Start in influxdb3_catalog/src/error.rs at the not-found error variant, then trace its use in influxdb3_catalog/src/catalog/update.rs around lines 204-206. Update the reported error to identify the resource type and, if supported, its name; verify the resulting catalog error wording in the relevant catalog tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100