pub enum DataError {
Sqlite(Error),
Csv(Error),
Io(Error),
InvalidIdentifier(String),
NoSuchTable(String),
EmptyCsv,
InvalidNotebook(String),
}Expand description
Everything that can go wrong inside the newt-data SQLite engine.
The three #[from] variants wrap the upstream errors verbatim so the
underlying cause is never lost; the remaining variants are the engine’s own
invariant violations (Phase 21 — identifier safety, table existence, and
the empty-CSV guard described in
docs/design/centaur-data-scientist.md).
Variants§
Sqlite(Error)
A SQLite operation failed (open, pragma, prepare, step, bind, …).
Csv(Error)
The CSV reader failed to parse the input (malformed record, unequal
field counts under flexible = false, encoding, …).
Io(Error)
A filesystem operation failed (creating the parent dir, opening the CSV path, …).
InvalidIdentifier(String)
A table identifier supplied to ingest_csv
is not a safe SQLite identifier: empty, or containing a NUL byte or a
double-quote. Defense in depth on top of the always-on
double-quote quoting (Phase 21 — identifier safety is a review focus).
NoSuchTable(String)
A table referenced by summarize does
not exist in the database.
EmptyCsv
The CSV had no header row, so no columns could be created.
InvalidNotebook(String)
An .ipynb notebook (Phase 21.4 — crate::notebook) could not be
read, parsed, or validated: the file is not valid JSON, its top-level
value is not an object, its nbformat is not 4, or it is otherwise not
a well-formed nbformat-4 document. The message names the offending file
and the specific reason so the MCP adapter surfaces an honest, in-band
tool error the model can read (never a panic). See
docs/design/centaur-data-scientist.md
§4.1, the notebook-artifact bullet.
Trait Implementations§
Source§impl Error for DataError
impl Error for DataError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()