-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 <resource> was not found, e.g.,
the requested database was not found
We could potentially extend this with the requested resource name as the requested <resource> named <resource_name> was not found, e.g.,
the requested database named foo was not found
Additional context
The variant that produces this error is here:
influxdb/influxdb3_catalog/src/error.rs
Lines 19 to 20 in 959555a
| #[error("the requested resource was not found")] | |
| NotFound, |
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:
influxdb/influxdb3_catalog/src/catalog/update.rs
Lines 204 to 206 in 959555a
| let Some(db) = self.db_schema(name) else { | |
| return Err(CatalogError::NotFound); | |
| }; |
We can include the resource type and name.