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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.13.1] - 2025-09-23

### Fixed
- Documented allowances for `clippy::result_large_err` on APIs that intentionally
expose the rich `AppError` payload, restoring lint-clean builds.

## [0.13.0] - 2025-09-23

### Added
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.13.0"
version = "0.13.1"
rust-version = "1.90"
edition = "2024"
license = "MIT OR Apache-2.0"
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ guides, comparisons with `thiserror`/`anyhow`, and troubleshooting recipes.

~~~toml
[dependencies]
masterror = { version = "0.13.0", default-features = false }
masterror = { version = "0.13.1", default-features = false }
# or with features:
# masterror = { version = "0.13.0", features = [
# masterror = { version = "0.13.1", features = [
# "axum", "actix", "openapi", "serde_json",
# "sqlx", "sqlx-migrate", "reqwest", "redis",
# "validator", "config", "tokio", "multipart",
Expand Down Expand Up @@ -76,10 +76,10 @@ masterror = { version = "0.13.0", default-features = false }
~~~toml
[dependencies]
# lean core
masterror = { version = "0.13.0", default-features = false }
masterror = { version = "0.13.1", default-features = false }

# with Axum/Actix + JSON + integrations
# masterror = { version = "0.13.0", features = [
# masterror = { version = "0.13.1", features = [
# "axum", "actix", "openapi", "serde_json",
# "sqlx", "sqlx-migrate", "reqwest", "redis",
# "validator", "config", "tokio", "multipart",
Expand Down Expand Up @@ -709,13 +709,13 @@ assert_eq!(resp.status, 401);
Minimal core:

~~~toml
masterror = { version = "0.13.0", default-features = false }
masterror = { version = "0.13.1", default-features = false }
~~~

API (Axum + JSON + deps):

~~~toml
masterror = { version = "0.13.0", features = [
masterror = { version = "0.13.1", features = [
"axum", "serde_json", "openapi",
"sqlx", "reqwest", "redis", "validator", "config", "tokio"
] }
Expand All @@ -724,7 +724,7 @@ masterror = { version = "0.13.0", features = [
API (Actix + JSON + deps):

~~~toml
masterror = { version = "0.13.0", features = [
masterror = { version = "0.13.1", features = [
"actix", "serde_json", "openapi",
"sqlx", "reqwest", "redis", "validator", "config", "tokio"
] }
Expand Down
4 changes: 2 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
~~~toml
[dependencies]
# минимальное ядро
masterror = { version = "0.13.0", default-features = false }
masterror = { version = "0.13.1", default-features = false }
# или с нужными интеграциями
# masterror = { version = "0.13.0", features = [
# masterror = { version = "0.13.1", features = [
# "axum", "actix", "openapi", "serde_json",
# "sqlx", "sqlx-migrate", "reqwest", "redis",
# "validator", "config", "tokio", "multipart",
Expand Down
2 changes: 2 additions & 0 deletions src/app_error/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ fn log_uses_kind_and_code() {

#[test]
fn result_alias_is_generic() {
// The alias intentionally preserves the full AppError payload size.
#[allow(clippy::result_large_err)]
fn app() -> super::AppResult<u8> {
Ok(1)
}
Expand Down
2 changes: 2 additions & 0 deletions src/response/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ impl ErrorResponse {
/// assert!(resp.details.is_some());
/// # }
/// ```
// AppError carries telemetry metadata; keep the rich payload despite the lint.
#[allow(clippy::result_large_err)]
pub fn with_details<T>(self, payload: T) -> AppResult<Self>
where
T: Serialize
Expand Down
7 changes: 3 additions & 4 deletions tests/ui/app_error/fail/enum_missing_variant.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
error: all variants must use #[app_error(...)] to derive AppError conversion
--> tests/ui/app_error/fail/enum_missing_variant.rs:8:5
|
8 | / #[error("without")]
9 | | Without,
| |___________^
8 | #[error("without")]
| ^

warning: unused import: `AppErrorKind`
--> tests/ui/app_error/fail/enum_missing_variant.rs:1:17
|
1 | use masterror::{AppErrorKind, Error};
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
4 changes: 2 additions & 2 deletions tests/ui/app_error/fail/missing_code.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ error: AppCode conversion requires `code = ...` in #[app_error(...)]
--> tests/ui/app_error/fail/missing_code.rs:9:5
|
9 | #[app_error(kind = AppErrorKind::Service)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^

warning: unused imports: `AppCode` and `AppErrorKind`
--> tests/ui/app_error/fail/missing_code.rs:1:17
|
1 | use masterror::{AppCode, AppErrorKind, Error};
| ^^^^^^^ ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
2 changes: 1 addition & 1 deletion tests/ui/app_error/fail/missing_kind.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error: missing `kind = ...` in #[app_error(...)]
--> tests/ui/app_error/fail/missing_kind.rs:5:1
|
5 | #[app_error(message)]
| ^^^^^^^^^^^^^^^^^^^^^
| ^
2 changes: 1 addition & 1 deletion tests/ui/formatter/fail/duplicate_fmt.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ error: duplicate `fmt` handler specified
--> tests/ui/formatter/fail/duplicate_fmt.rs:4:36
|
4 | #[error(fmt = crate::format_error, fmt = crate::format_error)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^
1 change: 0 additions & 1 deletion tests/ui/formatter/fail/implicit_after_named.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ error: multiple unused formatting arguments
| argument never used
| argument never used
|
= note: consider adding 2 format specifiers
= note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
4 changes: 2 additions & 2 deletions tests/ui/formatter/fail/unsupported_flag.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: placeholder spanning bytes 0..11 uses an unsupported formatter
--> tests/ui/formatter/fail/unsupported_flag.rs:4:10
--> tests/ui/formatter/fail/unsupported_flag.rs:4:9
|
4 | #[error("{value:##x}")]
| ^^^^^^^^^^^
| ^^^^^^^^^^^^^
4 changes: 2 additions & 2 deletions tests/ui/formatter/fail/unsupported_formatter.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: placeholder spanning bytes 0..9 uses an unsupported formatter
--> tests/ui/formatter/fail/unsupported_formatter.rs:4:10
--> tests/ui/formatter/fail/unsupported_formatter.rs:4:9
|
4 | #[error("{value:y}")]
| ^^^^^^^^^
| ^^^^^^^^^^^
4 changes: 2 additions & 2 deletions tests/ui/formatter/fail/uppercase_binary.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: placeholder spanning bytes 0..9 uses an unsupported formatter
--> tests/ui/formatter/fail/uppercase_binary.rs:4:10
--> tests/ui/formatter/fail/uppercase_binary.rs:4:9
|
4 | #[error("{value:B}")]
| ^^^^^^^^^
| ^^^^^^^^^^^
4 changes: 2 additions & 2 deletions tests/ui/formatter/fail/uppercase_pointer.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: placeholder spanning bytes 0..9 uses an unsupported formatter
--> tests/ui/formatter/fail/uppercase_pointer.rs:4:10
--> tests/ui/formatter/fail/uppercase_pointer.rs:4:9
|
4 | #[error("{value:P}")]
| ^^^^^^^^^
| ^^^^^^^^^^^
2 changes: 1 addition & 1 deletion tests/ui/masterror/fail/duplicate_attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ warning: unused imports: `AppCode` and `AppErrorKind`
1 | use masterror::{AppCode, AppErrorKind, Masterror};
| ^^^^^^^ ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
2 changes: 1 addition & 1 deletion tests/ui/masterror/fail/duplicate_telemetry.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ warning: unused imports: `AppCode` and `AppErrorKind`
1 | use masterror::{AppCode, AppErrorKind, Masterror};
| ^^^^^^^ ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
2 changes: 1 addition & 1 deletion tests/ui/masterror/fail/empty_redact.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ warning: unused imports: `AppCode` and `AppErrorKind`
1 | use masterror::{AppCode, AppErrorKind, Masterror};
| ^^^^^^^ ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
7 changes: 3 additions & 4 deletions tests/ui/masterror/fail/enum_missing_variant.stderr
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
error: all variants must use #[masterror(...)] to derive masterror::Error conversion
--> tests/ui/masterror/fail/enum_missing_variant.rs:8:5
|
8 | / #[error("missing")]
9 | | Missing
| |___________^
8 | #[error("missing")]
| ^

warning: unused imports: `AppCode` and `AppErrorKind`
--> tests/ui/masterror/fail/enum_missing_variant.rs:1:17
|
1 | use masterror::{AppCode, AppErrorKind, Masterror};
| ^^^^^^^ ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
4 changes: 2 additions & 2 deletions tests/ui/masterror/fail/missing_category.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ error: missing `category = ...` in #[masterror(...)]
--> tests/ui/masterror/fail/missing_category.rs:5:1
|
5 | #[masterror(code = AppCode::Internal)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^

warning: unused import: `AppCode`
--> tests/ui/masterror/fail/missing_category.rs:1:17
|
1 | use masterror::{AppCode, Masterror};
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
4 changes: 2 additions & 2 deletions tests/ui/masterror/fail/missing_code.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ error: missing `code = ...` in #[masterror(...)]
--> tests/ui/masterror/fail/missing_code.rs:5:1
|
5 | #[masterror(category = AppErrorKind::Internal)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^

warning: unused import: `AppErrorKind`
--> tests/ui/masterror/fail/missing_code.rs:1:17
|
1 | use masterror::{AppErrorKind, Masterror};
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
2 changes: 1 addition & 1 deletion tests/ui/masterror/fail/unknown_option.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ warning: unused imports: `AppCode` and `AppErrorKind`
1 | use masterror::{AppCode, AppErrorKind, Masterror};
| ^^^^^^^ ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
= note: `#[warn(unused_imports)]` on by default
Loading