Skip to content

Not found errors from the catalog should indicate which resource was not found #26465

@hiltontj

Description

@hiltontj

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:

#[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:

let Some(db) = self.db_schema(name) else {
return Err(CatalogError::NotFound);
};

We can include the resource type and name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions