Skip to content

Releases: RAprogramm/masterror

v0.10.0

20 Sep 11:52

Choose a tag to compare

Added

  • Preserved the raw format fragment for display-only placeholders, exposing it
    through TemplateFormatter::display_spec()/format_fragment() so derived
    implementations can forward :>8, :.3, and similar specifiers to
    write!.

Changed

  • TemplateFormatter now owns display specs and TemplatePlaceholder::formatter
    returns a reference to reflect the richer formatter representation.

Tests

  • Added a trybuild pass case and runtime assertions covering display alignment,
    precision, and fill specifiers to prevent regressions.

Documentation

  • Documented the new display formatter support in the README (including the
    Russian translation) with examples showing how to recover preserved specs.

v0.9.0

20 Sep 11:52

Choose a tag to compare

Added

  • Parsed dot-prefixed display shorthands into a projection AST so .limits.lo,
    .0.data, and chained method calls like .suggestion.as_ref().map_or_else(...)
    resolve against struct fields and variant bindings.
  • Extended the error_derive integration suite and trybuild fixtures with
    regressions covering nested projections for named and tuple variants.

Changed

  • Shorthand resolution now builds expressions from the projection AST, preserving
    raw identifiers, tuple indices, and method invocations when generating code.

Documentation

  • Documented the richer shorthand projection support in the README and template
    so downstream users know complex field/method chains are available.

v0.8.0

20 Sep 11:52

Choose a tag to compare

Added

  • Recognised #[provide(ref = ..., value = ...)] on struct and enum fields,
    allowing derived errors to surface domain telemetry through
    std::error::Request alongside backtraces.

Changed

  • masterror-derive now generates provide implementations whenever custom
    telemetry is requested, forwarding Request values to sources and invoking
    provide_ref/provide_value with proper Option handling.

Tests

  • Extended the error_derive integration suite with regressions covering
    telemetry provided by structs, tuple variants and optional fields, including
    both reference and owned payloads.

Documentation

  • Documented the #[provide(...)] attribute in the README with examples showing
    reference and owned telemetry as well as optional fields.

v0.7.0

20 Sep 11:52

Choose a tag to compare

Added

  • Recognised #[app_error(...)] on derived structs and enum variants, capturing
    the mapped AppErrorKind, optional AppCode and whether the formatted
    Display output should become the public message.
  • Generated From<Error> implementations that construct masterror::AppError
    (and, when requested, AppCode) by matching on enum variants and invoking
    AppError::with/AppError::bare.

Tests

  • Introduced trybuild fixtures covering successful struct/enum conversions and
    compile failures for missing metadata, including message propagation checks in
    the passing cases.

Documentation

  • Documented the #[app_error(...)] attribute in the README, outlining the
    struct and enum mapping patterns and the message flag behaviour.

v0.6.5

20 Sep 11:52

Choose a tag to compare

Added

  • Accepted .field and .0 shorthand expressions in #[error("...")] format
    argument lists, resolving them against struct and variant fields without
    moving the original values.

Changed

  • The format argument resolver now tracks whether it operates on a struct or a
    destructured enum variant, allowing field shorthands to reuse local bindings
    and honour pointer formatting requirements.

Tests

  • Added trybuild pass cases covering named, positional and implicit arguments,
    formatter path handlers and the new field shorthand expressions.
  • Introduced compile-fail fixtures for duplicate argument names, mixing
    implicit placeholders after explicitly indexed ones and combining
    transparent with fmt handlers.
  • Extended the runtime error_derive suite with assertions exercising the
    shorthand field accessors.

v0.6.4

20 Sep 11:52

Choose a tag to compare

Added

  • Exposed an internal provide shim that mirrors thiserror's
    ThiserrorProvide, enabling derived errors to forward
    core::error::Request values to their sources.

Changed

  • Allow #[backtrace] to be paired with #[source]/#[from] fields when the
    field type implements Error, while retaining diagnostics for incompatible
    non-source fields.
  • Track whether backtrace detection is explicit or inferred so generated
    implementations avoid providing the same backtrace twice when delegating to
    sources.
  • Update the generated provide methods to call thiserror_provide on source
    fields before exposing the stored backtrace, ensuring delegated traces reach
    callers.

Tests

  • Added regression tests covering direct and optional sources annotated with
    #[backtrace], validating delegated backtrace propagation and None
    handling.

v0.6.3

20 Sep 11:52

Choose a tag to compare

Added

  • Invoke custom #[error(fmt = <path>)] handlers for structs and enum variants,
    borrowing fields and forwarding the formatter reference just like thiserror.

Changed

  • Ensure duplicate fmt attributes report a single diagnostic without
    suppressing the derived display implementation.

Tests

  • Extend the formatter trybuild suite with success cases covering struct and
    enum formatter paths.

v0.6.2

20 Sep 11:51

Choose a tag to compare

Added

  • Resolve #[error("...")] format arguments when generating Display
    implementations, supporting named bindings, explicit indices and implicit
    placeholders via a shared argument environment.

Changed

  • Detect additional format arguments, implicit placeholders and non-Display
    formatters in render_template, delegating complex cases to a single
    write! invocation while retaining the lightweight f.write_str path for
    literal-only templates. The helper that assembles format arguments now keeps
    positional/implicit bindings ahead of named ones to satisfy the formatting
    macro contract.

Tests

  • Cover named format argument expressions, implicit placeholder ordering and
    enum variants using format arguments.

v0.6.0

20 Sep 11:51

Choose a tag to compare

Added

  • Recognised empty placeholder bodies ({} / {:?}) as implicit positional
    identifiers, numbering them by appearance and exposing the new
    TemplateIdentifier::Implicit variant in the template API.
  • Propagated the implicit identifier metadata through
    template_support::TemplateIdentifierSpec, ensuring derive-generated display
    implementations resolve tuple fields in placeholder order.

Fixed

  • Preserved TemplateError::EmptyPlaceholder diagnostics for whitespace-only
    placeholders, matching previous error reporting for invalid bodies.

Tests

  • Added parser regressions covering implicit placeholder sequencing and the
    whitespace-only error path.

v0.5.15

20 Sep 11:51

Choose a tag to compare

Added

  • Parse #[error("...")] attribute arguments into structured FormatArg
    entries, tracking named bindings and positional indices for future
    format_args! integration.
  • Recognise #[error(fmt = <path>)] handlers, capturing the formatter path and
    associated arguments while guarding against duplicate fmt specifications.

Fixed

  • Produce dedicated diagnostics when unsupported combinations are used, such as
    providing format arguments alongside #[error(transparent)].

Tests

  • Extend the trybuild suite with regression cases covering duplicate fmt
    handlers and transparent attributes that erroneously include arguments.