Releases: RAprogramm/masterror
Releases · RAprogramm/masterror
v0.10.0
Added
- Preserved the raw format fragment for display-only placeholders, exposing it
throughTemplateFormatter::display_spec()/format_fragment()so derived
implementations can forward:>8,:.3, and similar specifiers to
write!.
Changed
TemplateFormatternow owns display specs andTemplatePlaceholder::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
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_deriveintegration 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
Added
- Recognised
#[provide(ref = ..., value = ...)]on struct and enum fields,
allowing derived errors to surface domain telemetry through
std::error::Requestalongside backtraces.
Changed
masterror-derivenow generatesprovideimplementations whenever custom
telemetry is requested, forwardingRequestvalues to sources and invoking
provide_ref/provide_valuewith properOptionhandling.
Tests
- Extended the
error_deriveintegration 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
Added
- Recognised
#[app_error(...)]on derived structs and enum variants, capturing
the mappedAppErrorKind, optionalAppCodeand whether the formatted
Displayoutput should become the public message. - Generated
From<Error>implementations that constructmasterror::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 themessageflag behaviour.
v0.6.5
Added
- Accepted
.fieldand.0shorthand 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
transparentwithfmthandlers. - Extended the runtime
error_derivesuite with assertions exercising the
shorthand field accessors.
v0.6.4
Added
- Exposed an internal
provideshim that mirrorsthiserror's
ThiserrorProvide, enabling derived errors to forward
core::error::Requestvalues to their sources.
Changed
- Allow
#[backtrace]to be paired with#[source]/#[from]fields when the
field type implementsError, 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
providemethods to callthiserror_provideon 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 andNone
handling.
v0.6.3
Added
- Invoke custom
#[error(fmt = <path>)]handlers for structs and enum variants,
borrowing fields and forwarding the formatter reference just likethiserror.
Changed
- Ensure duplicate
fmtattributes 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
Added
- Resolve
#[error("...")]format arguments when generatingDisplay
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 inrender_template, delegating complex cases to a single
write!invocation while retaining the lightweightf.write_strpath 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
Added
- Recognised empty placeholder bodies (
{}/{:?}) as implicit positional
identifiers, numbering them by appearance and exposing the new
TemplateIdentifier::Implicitvariant 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::EmptyPlaceholderdiagnostics 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
Added
- Parse
#[error("...")]attribute arguments into structuredFormatArg
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 duplicatefmtspecifications.
Fixed
- Produce dedicated diagnostics when unsupported combinations are used, such as
providing format arguments alongside#[error(transparent)].
Tests
- Extend the
trybuildsuite with regression cases covering duplicatefmt
handlers and transparent attributes that erroneously include arguments.