#![doc = include_str!("../README.md")]
mod context;
mod error;
mod extensions;
mod helpers;
mod hook;
mod middleware;
pub use context::ApiErrorContext;
pub use error::{is_expose_errors_enabled, set_expose_errors, ApiError, ApiErrorBuilder};
pub use extensions::{IntoApiError, OptionExt, ResultExt};
pub use helpers::{
bad_gateway, bad_request, conflict, forbidden, gateway_timeout, internal_error,
method_not_allowed, not_found, service_unavailable, too_many_requests, unauthorized,
unprocessable_entity,
};
pub use hook::on_error;
pub use middleware::ErrorInterceptorLayer;
use anyhow::Result;
pub type ApiResult<T> = Result<T, ApiError>;