categorize_error (src/error_category.rs)

duckle · crates/duckdb-engine/src/error_category.rs · rust · Apache-2.0
auth

Rust function categorizing error messages into coarse buckets for logging and alerts.

// Source: https://github.com/slothflowlabs/duckle | License: Apache-2.0 | Copyright 2026 SlothFlowLabs
// Provided via justclaw.it.com; keep this notice with the code.
//! Coarse error categorization for run results, alerts, and logs.
//!
//! Connector and DuckDB failures all reach the run report as strings
//! (`EngineError::Query(msg)` mostly), which makes programmatic routing -
//! "retry network errors, fail fast on schema errors", alert payloads,
//! log filtering in Splunk - impossible without parsing prose. This module
//! buckets an error message into a small, stable set of categories by
//! pattern-matching the text. The mapping is heuristic by design: it only
//! has to be useful, not perfect, and `other` is always a safe answer.
//!
//! Categories (stable, lowercase - external 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key