Skip to main content

Module error_data

Module error_data 

Source
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§

ErrorData
RAII wrapper for a duckdb_error_data handle.

Enums§

DuckDbErrorType
The category of a DuckDB error, mirroring duckdb_error_type.

Functions§

check_valid_utf8
Checks whether bytes form a valid UTF-8 string according to DuckDB’s validator (DuckDB 1.5.0+).