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

## [Unreleased]

## [0.15.0] - 2025-09-25

### Added
- Introduced a `response::problem_json` module with an RFC7807 `ProblemJson`
payload that serializes metadata, gRPC mappings and retry/authentication
hints while respecting the message redaction policy.
- Added an optional `tonic` feature exposing `TryFrom<Error> for tonic::Status`
with sanitized metadata and canonical gRPC code mapping.
- Published a compile-time `CODE_MAPPINGS` table mapping each `AppCode` to
HTTP, gRPC and problem type information for reuse across transports.

### Changed
- Updated Axum and Actix integrations to emit `application/problem+json`
bodies, attach `Retry-After`/`WWW-Authenticate` headers automatically and
avoid leaking redactable messages or metadata.
- Re-exported `ProblemJson` from the crate root alongside `ErrorResponse` for
direct construction in custom handlers.

### Tests
- Added unit coverage for the problem+json metadata sanitizer, header
propagation in Axum, and gRPC code mapping under the new `tonic` feature.


## [0.14.1] - 2025-09-25

### Changed
Expand Down
194 changes: 187 additions & 7 deletions Cargo.lock

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

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masterror"
version = "0.14.1"
version = "0.15.0"
rust-version = "1.90"
edition = "2024"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -71,6 +71,7 @@ teloxide = ["dep:teloxide-core"]
telegram-webapp-sdk = ["dep:telegram-webapp-sdk"]
frontend = ["dep:wasm-bindgen", "dep:js-sys", "dep:serde-wasm-bindgen"]
turnkey = []
tonic = ["dep:tonic"]
openapi = ["dep:utoipa"]

[workspace.dependencies]
Expand Down Expand Up @@ -119,6 +120,7 @@ serde-wasm-bindgen = { version = "0.6", optional = true }
uuid = { version = "1", default-features = false, features = [
"std"
] }
tonic = { version = "0.12", optional = true }

[dev-dependencies]
serde_json = "1"
Expand Down Expand Up @@ -156,6 +158,7 @@ feature_order = [
"multipart",
"teloxide",
"telegram-webapp-sdk",
"tonic",
"frontend",
"turnkey",
]
Expand Down Expand Up @@ -225,6 +228,9 @@ description = "Convert teloxide_core::RequestError into domain errors"
[package.metadata.masterror.readme.features."telegram-webapp-sdk"]
description = "Surface Telegram WebApp validation failures"

[package.metadata.masterror.readme.features.tonic]
description = "Convert AppError into tonic::Status with redaction"

[package.metadata.masterror.readme.features.frontend]
description = "Log to the browser console and convert to JsValue on WASM"

Expand Down
Loading
Loading