1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Unified error types for FraiseQL runtime crates.
//!
//! All runtime crates depend on this crate for error handling.
//!
//! # Canonical taxonomy
//!
//! [`FraiseQLError`] is the single root error type for the FraiseQL workspace.
//! It is built around two layers:
//!
//! 1. **Engine variants** (`Parse`, `Validation`, `Database`, `RateLimited`, `NotFound`,
//! `ServiceUnavailable`, `Internal`, …) which the core and runtime crates raise directly.
//! 2. **Domain composition variants** (`Auth`, `Webhook`, `Observer`, `File`) which wrap subsystem
//! error types via `From` impls owned by each subsystem crate (sqlx pattern). This lets
//! `fraiseql-error` stay a leaf crate while still exposing one unified taxonomy.
//!
//! With the `axum-compat` feature enabled, [`FraiseQLError`] also implements
//! [`axum::response::IntoResponse`] so handlers can return
//! `Result<_, FraiseQLError>` directly; the conversion produces an
//! [`ErrorResponse`] JSON body with the appropriate HTTP status code.
//!
//! ```text
//! FraiseQLError
//! ↓ IntoResponse (via fraiseql-error::http, feature `axum-compat`)
//! ErrorResponse { error, error_description, error_code, error_uri, details, retry_after }
//! ↓ Json(response) + StatusCode
//! HTTP response body (application/json)
//! ```
//!
//! ## Security note
//!
//! All variants that might leak internal details (database messages, config values,
//! provider endpoints) return **generic** descriptions in the HTTP response body.
//! Raw error details are available only in structured server logs.
// Wave 9 (Q4): pilot crate for the workspace `clippy::indexing_slicing` rollout.
// All library code is panic-free w.r.t. slice/vec indexing; the lint is denied
// here at the crate level. Test files opt out individually with a `Reason:`.
pub use ConfigError;
pub use ;
pub use FileError;
pub use ;
// Re-export for convenience — only available with the `axum-compat` feature
pub use ;