Skip to content

Releases: RAprogramm/masterror

v0.17.0

24 Sep 11:16

Choose a tag to compare

Added

  • Per-field redaction metadata via a new [FieldRedaction] enum, default
    heuristics for common secret keys (passwords, tokens, card numbers) and the
    Context::redact_field / AppError::redact_field helpers.
  • #[masterror(redact(fields(...)))] support in the derive macro to configure
    metadata policies alongside message redaction.
  • Opt-in internal formatters for [ErrorResponse] and [ProblemJson] that are
    safe to use in diagnostic logs without additional serialization boilerplate.

Changed

  • Problem JSON and legacy ErrorResponse serialization now hash, mask or drop
    metadata according to per-field policies while honoring the global redaction
    flag.
  • Redaction-aware conversions ensure redactable messages fall back to the error
    kind across HTTP and gRPC mappings.

v0.16.0

24 Sep 11:16

Choose a tag to compare

Changed

  • Switched the internal AppError source storage to Arc<dyn Error> and added a
    shared with_source_arc helper so conversions can reuse existing Arc
    handles without extra allocations.
  • Replaced the backtrace slot with an Option<Backtrace> managed through an
    environment-aware lazy capture that respects RUST_BACKTRACE and avoids
    snapshot allocation when disabled.
  • Updated the masterror::Error derive and ResultExt conversions to forward
    sources using the new shared storage while preserving error chains.

Tests

  • Added regression coverage for the std::error::Error chain, Arc source
    preservation in the derives, and conditional backtrace capture driven by the
    RUST_BACKTRACE environment variable.

v0.15.0

24 Sep 11:16

Choose a tag to compare

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.

v0.14.1

24 Sep 11:16

Choose a tag to compare

Changed

  • Boxed the internal AppError payload inside a new ErrorInner allocation,
    keeping public field access via Deref while shrinking the error to a
    pointer-sized handle that shares metadata, retry hints, and backtrace state.

Removed

  • Dropped clippy::result_large_err allowances in response helpers and tests
    now that AppError is pointer-sized and lint-clean without suppressions.

Fixed

  • Removed the unused BacktraceSlot::get helper to restore builds with -D warnings.
  • Simplified the metrics recorder test harness with dedicated types to satisfy
    clippy::type_complexity without sacrificing coverage.

v0.14.0

24 Sep 11:16

Choose a tag to compare

Added

  • Introduced optional tracing, metrics and backtrace features. When
    enabled they emit structured tracing events, increment the
    error_total{code,category} counter and capture lazy [Backtrace] snapshots
    from a new AppError::emit_telemetry hook.

Changed

  • Reworked the AppError core to emit telemetry exactly once, track dirty
    mutations and expose a crate-private new_raw constructor for contexts that
    enrich errors before flushing instrumentation.
  • Updated Axum and Actix integrations to rely on the telemetry hook instead of
    manually logging errors while preserving backward-compatible APIs.

Tests

  • Added tracing dispatcher coverage to assert a single telemetry event with MDC
    propagated trace_id values.
  • Installed a deterministic metrics recorder in unit tests to confirm
    error_total increments once per error.

v0.13.1

24 Sep 11:16

Choose a tag to compare

Fixed

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

v0.13.0

24 Sep 11:15

Choose a tag to compare

Added

  • Introduced #[derive(Masterror)] and the #[masterror(...)] attribute to
    convert domain errors directly into [masterror::Error] while capturing
    metadata, message redaction policy and optional transport mappings.
  • Added transport mapping descriptors in mapping::{HttpMapping, GrpcMapping, ProblemMapping} generated by the new derive for HTTP/gRPC/problem-json
    integrations.

Changed

  • Re-exported the Masterror derive from the crate root alongside the existing
    Error derive.

Documentation

  • Expanded crate docs and both READMEs with Masterror examples, telemetry
    guidance and redaction policy notes.

Tests

  • Added integration tests and trybuild coverage exercising the
    #[masterror(...)] attribute and generated mapping tables.

v0.12.1

24 Sep 11:15

Choose a tag to compare

Added

  • Introduced the Context builder for enriching error conversions with
    metadata, caller tracking, and redaction hints via ResultExt::ctx.
  • Implemented the ResultExt trait to wrap fallible operations into
    masterror::Error without extra allocations while merging context fields.

Documentation

  • Added rustdoc examples showcasing Context chaining and the new
    ResultExt helper.

Tests

  • Added unit coverage for ResultExt::ctx, ensuring happy-path results pass
    through and error branches preserve metadata and sources.

v0.12.0

24 Sep 11:15

Choose a tag to compare

Added

  • Introduced typed Metadata storage with Field/FieldValue builders and helper functions in field::*.
  • Captured error sources and backtraces inside the new app_error::Error container, exposing MessageEditPolicy to control redaction.

Changed

  • Replaced the legacy AppError struct with the richer Error model carrying AppCode, metadata, retry/auth hints and transport policy.
  • Updated response mapping and constructors to preserve machine-readable codes without extra allocations.

Documentation

  • Refreshed crate docs, README (EN/RU) and examples to highlight metadata helpers and the new error contract.

Tests

  • Added regression coverage ensuring codes, metadata and sources survive conversions without unnecessary cloning.

v0.11.2

24 Sep 11:15

Choose a tag to compare

Changed

  • Surfaced the [AppErrorKind] display text as the fallback ErrorResponse
    message so clients receive semantic descriptions without providing a custom
    message.

Tests

  • Added regression coverage ensuring bare AppError kinds map to their
    corresponding default message.