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
// SPDX-License-Identifier: Apache-2.0
//! Standardized error types for the NodeDB public API.
//!
//! [`NodeDbError`] is a **struct** (not an enum) that separates:
//! - `code` — stable numeric code for programmatic handling (`NDB-1000`)
//! - `message` — human-readable explanation
//! - `details` — machine-matchable [`ErrorDetails`] enum with structured data
//! - `cause` — optional chained error for debugging
//!
//! # Wire format
//!
//! Serializes to:
//! ```json
//! {
//! "code": "NDB-1000",
//! "message": "constraint violation on users: duplicate email",
//! "details": { "kind": "constraint_violation", "collection": "users" }
//! }
//! ```
//!
//! # Error code ranges
//!
//! | Range | Category |
//! |-------------|---------------|
//! | 1000–1099 | Write path |
//! | 1100–1199 | Read path |
//! | 1200–1299 | Query |
//! | 2000–2099 | Auth/Security |
//! | 3000–3099 | Sync |
//! | 4000–4099 | Storage |
//! | 4100–4199 | WAL |
//! | 4200–4299 | Serialization |
//! | 5000–5099 | Config |
//! | 6000–6099 | Cluster |
//! | 7000–7099 | Memory |
//! | 8000–8099 | Encryption |
//! | 9000–9099 | Internal |
pub use ErrorCode;
pub use ErrorDetails;
pub use ;