- Cargo workspace with 6 crates: shared, storaged, catalogd, queryd, aibridge, gateway - shared: types (DatasetId, ObjectRef, SchemaFingerprint, DatasetManifest) + error enum - gateway: Axum HTTP entrypoint with nested service routers + tracing - All services expose /health stubs - justfile with build/test/run recipes - PRD, phase tracker, and ADR docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
853 B
Rust
36 lines
853 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum LakehouseError {
|
|
#[error("dataset not found: {0}")]
|
|
DatasetNotFound(String),
|
|
|
|
#[error("object not found: {bucket}/{key}")]
|
|
ObjectNotFound { bucket: String, key: String },
|
|
|
|
#[error("storage error: {0}")]
|
|
Storage(String),
|
|
|
|
#[error("catalog error: {0}")]
|
|
Catalog(String),
|
|
|
|
#[error("query error: {0}")]
|
|
Query(String),
|
|
|
|
#[error("ai bridge error: {0}")]
|
|
AiBridge(String),
|
|
|
|
#[error("serialization error: {0}")]
|
|
Serialization(String),
|
|
}
|
|
|
|
impl LakehouseError {
|
|
pub fn status_code(&self) -> u16 {
|
|
match self {
|
|
Self::DatasetNotFound(_) | Self::ObjectNotFound { .. } => 404,
|
|
Self::Storage(_) | Self::Catalog(_) | Self::Query(_) | Self::AiBridge(_) => 500,
|
|
Self::Serialization(_) => 400,
|
|
}
|
|
}
|
|
}
|