Skip to main content

Module codes

Module codes 

Source
Expand description

Structured error codes emitted in the data.code field of every MCP error response. These are &'static str constants so callers can pattern-match them programmatically.

Constants§

ALIAS_ALREADY_EXISTS
Returned when alias_create is called but an alias with the same name already exists in the table’s _aliases storage.
ALIAS_NOT_FOUND
Returned when a named query alias does not exist in _aliases.
ALIAS_PARAMS_REQUIRED
Returned when alias_run is called without params but the alias has a non-null params_schema (i.e. the alias requires parameter injection).
ALIAS_TEMPLATE_ERROR
Returned when MiniJinja template rendering fails (syntax error or missing variable) during alias_run.
AMBIGUOUS_ID
Returned when an id prefix matches more than one row and the caller must disambiguate by using a longer prefix or the full UUID.
BACKUP_ERROR
Returned when a backup I/O or SQLite backup operation fails.
BATCH_ABORTED
Returned when schema_batch is aborted because one of its ops fails.
CONFIG_ERROR
Returned when environment-variable or .env configuration is invalid.
IO_ERROR
Returned when an I/O operation (file open, read) fails.
MATERIALIZE_DEST_INVALID
Returned when the row_materialize dest path is invalid for another reason.
MATERIALIZE_DEST_RELATIVE
Returned when the row_materialize dest path is relative (absolute required).
MATERIALIZE_EMPTY_RESULT
Returned when the filter in row_materialize matches zero rows.
MATERIALIZE_FIELD_UNKNOWN
Returned when a projected field name is not present in the schema.
MATERIALIZE_FORMAT_ERROR
Returned when serialization to the requested format fails during row_materialize.
MATERIALIZE_INVALID_PARAM
Returned when row_materialize parameters are structurally invalid.
MATERIALIZE_IO_ERROR
Returned when a file I/O error occurs during row_materialize.
MATERIALIZE_ROW_NOT_FOUND
Returned when the specified row id is not found during row_materialize.
MATERIALIZE_SHA256_ERROR
Returned when SHA-256 computation fails during row_materialize.
NOT_FOUND
Returned when a requested row does not exist.
SCHEMA_ERROR
Returned when schema.yaml cannot be parsed or is structurally invalid.
SCHEMA_EXISTS
Returned when a schema file already exists and schema_create would overwrite it.
SNAPSHOT_ERROR
Returned when a snapshot I/O or SQLite snapshot operation fails.
STORAGE_ERROR
Returned when a SQLite operation fails.
TABLE_NOT_FOUND
Returned when the requested table is not mounted in the registry.
TABLE_REQUIRED
Returned when table argument is required but was omitted.
VALIDATION_ERROR
Returned when a required field is missing or a value has the wrong type.