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
55
// SPDX-FileCopyrightText: 2025 RAprogramm <andrey.rozanov.vl@gmail.com>
//
// SPDX-License-Identifier: MIT
//! Minimal, opt-in prelude for application crates.
//!
//! # Purpose
//!
//! This module provides a small set of re-exports for the most common types
//! when working with application errors.
//! Importing this prelude keeps handler and service signatures concise without
//! polluting the namespace with rarely used items.
//!
//! # Example
//!
//! ```rust
//! use masterror::prelude::*;
//!
//! fn demo(flag: bool) -> AppResult<()> {
//! if !flag {
//! return Err(AppError::new(AppErrorKind::BadRequest, "flag_required"));
//! }
//! Ok(())
//! }
//! ```
//!
//! # Design notes
//!
//! - Only the **core error types** are re-exported here.
//! - Optional framework integrations (e.g. `IntoResponse` for Axum, Actix
//! `Responder`) remain gated behind feature flags and do not require explicit
//! imports from this prelude.
//! - This keeps the public surface small, predictable, and easy to reason
//! about.
/// Stable machine-readable error code used in wire contracts.
pub use crateAppCode;
/// Core application error type (`kind` + optional message).
pub use crateAppError;
/// High-level taxonomy of application errors (stable categories).
pub use crateAppErrorKind;
/// Convenience alias for returning [`AppError`] from handlers/services.
pub use crateAppResult;
/// Stable wire-level error payload for HTTP APIs.
pub use crateErrorResponse;
/// Turnkey-specific error taxonomy and helpers (enabled with the `turnkey`
/// feature).
///
/// Re-exports:
/// - [`TurnkeyErrorKind`] — stable categories for Turnkey-specific failures
/// - [`TurnkeyError`] — error container with kind + public message
/// - [`classify_turnkey_error`] — heuristic classifier for raw SDK/provider
/// strings
pub use crate;