Expand description
Structured error data (DuckDB 1.5.0+).
ErrorData is an RAII wrapper around DuckDB’s duckdb_error_data handle —
the structured error type returned by several 1.5.0 C API surfaces, including
expression folding (Expression::fold),
the file system API (crate::file_system), and the appender error accessor
(Appender::error_data).
Unlike a bare error string, an ErrorData carries both a human-readable
message and a machine-readable DuckDbErrorType category, so an extension
can branch on the kind of failure (e.g. distinguishing IO from
OutOfMemory).
§Example
use quack_rs::error_data::{DuckDbErrorType, ErrorData};
// Construct a structured error to hand back to DuckDB.
let err = ErrorData::new(DuckDbErrorType::InvalidInput, "row index out of range");
assert!(err.has_error());
assert_eq!(err.error_type(), DuckDbErrorType::InvalidInput);Structs§
- Error
Data - RAII wrapper for a
duckdb_error_datahandle.
Enums§
- Duck
DbError Type - The category of a
DuckDBerror, mirroringduckdb_error_type.
Functions§
- check_
valid_ utf8 - Checks whether
bytesform a valid UTF-8 string according toDuckDB’s validator (DuckDB1.5.0+).