Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.24.12] - 2025-10-28

### Fixed
- Gated documentation examples that rely on the standard library and switched
the `ErrorResponse` retry example to `core::time::Duration` so docs compile
without the `std` feature.

## [0.24.11] - 2025-10-27

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masterror"
version = "0.24.11"
version = "0.24.12"
rust-version = "1.90"
edition = "2024"
license = "MIT OR Apache-2.0"
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ The build script keeps the full feature snippet below in sync with

~~~toml
[dependencies]
masterror = { version = "0.24.11", default-features = false }
masterror = { version = "0.24.12", default-features = false }
# or with features:
# masterror = { version = "0.24.11", features = [
# masterror = { version = "0.24.12", features = [
# "std", "axum", "actix", "openapi",
# "serde_json", "tracing", "metrics", "backtrace",
# "sqlx", "sqlx-migrate", "reqwest", "redis",
Expand Down Expand Up @@ -446,4 +446,3 @@ assert_eq!(problem.grpc.expect("grpc").name, "UNAUTHENTICATED");
---

MSRV: **1.90** · License: **MIT OR Apache-2.0** · No `unsafe`

2 changes: 2 additions & 0 deletions src/app_error/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{AppCode, AppErrorKind};
/// # Examples
///
/// ```rust
/// # #[cfg(feature = "std")] {
/// use std::io::{Error as IoError, ErrorKind};
///
/// use masterror::{AppErrorKind, Context, ResultExt, field};
Expand All @@ -36,6 +37,7 @@ use crate::{AppCode, AppErrorKind};
///
/// assert_eq!(err.kind, AppErrorKind::Service);
/// assert!(err.metadata().get("operation").is_some());
/// # }
/// ```
#[derive(Debug, Clone)]
pub struct Context {
Expand Down
4 changes: 4 additions & 0 deletions src/app_error/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,13 @@ impl Error {
/// # Examples
///
/// ```rust
/// # #[cfg(feature = "std")] {
/// use masterror::AppError;
///
/// let err = AppError::service("downstream degraded")
/// .with_context(std::io::Error::new(std::io::ErrorKind::Other, "boom"));
/// assert!(err.source_ref().is_some());
/// # }
/// ```
#[must_use]
pub fn with_context(self, context: impl Into<ContextAttachment>) -> Self {
Expand Down Expand Up @@ -495,6 +497,7 @@ impl Error {
/// # Examples
///
/// ```rust
/// # #[cfg(feature = "std")] {
/// use std::sync::Arc;
///
/// use masterror::{AppError, AppErrorKind};
Expand All @@ -503,6 +506,7 @@ impl Error {
/// let err = AppError::internal("boom").with_source_arc(source.clone());
/// assert!(err.source_ref().is_some());
/// assert_eq!(Arc::strong_count(&source), 2);
/// # }
/// ```
#[must_use]
pub fn with_source_arc(mut self, source: Arc<dyn CoreError + Send + Sync + 'static>) -> Self {
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,13 @@
//!
//! Attach upstream diagnostics without cloning existing `Arc`s:
//! ```rust
//! # #[cfg(feature = "std")] {
//! use masterror::AppError;
//!
//! let err = AppError::internal("db down")
//! .with_context(std::io::Error::new(std::io::ErrorKind::Other, "boom"));
//! assert!(err.source_ref().is_some());
//! # }
//! ```
//!
//! [`AppErrorKind`] controls the default HTTP status mapping.
Expand Down
2 changes: 1 addition & 1 deletion src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! # Example
//!
//! ```rust
//! use std::time::Duration;
//! use core::time::Duration;
//!
//! use masterror::{AppCode, ErrorResponse};
//!
Expand Down
Loading