New Features
-
attach scalar metadata to error contexts
Callers can enrich errors with named values they already possess without
introducing a custom payload type.Metadatakeeps a message and an ordered
dictionary of typed scalar values, including lossless bytes and native paths. -
inspect borrowed error classifications lazily
Admittedly, I was mostly checking the public API, thinking that it's
most certainly useful and overally, having lazy iterators for everything
is a step in the right direction.This wasn't a crazily detailed review in the interest of time.
Error inspection rebuilt the entire error graph before returning its first
item, so even a root match visited unrelated sources and allocated storage.
Use a shared iterator that expands each node only when another item is needed,
preserving breadth-first order, concrete types, and caller locations in both
error representations.Expose
classify(&error)for custom borrowed errors, and share classification
predicates withErrorandExn. The shared traversal and predicate definitions
remove more code than the borrowed API adds. Keepprobable_cause()unchanged. -
expose borrowed exception retry policies
Add
Exn::can_retry()andExn::can_retry_lenient()using the existing
classification and retry rules. Callers can now inspect retry policies
without consuming an exception to produceError.Cover native sources, nested errors, explicit markers, all recognized I/O
retry kinds, and allocation failures in both error storage modes. -
expose borrowed exception classifications
Add
Exn::classify()so callers can inspect normalized classes and their
original errors without converting the exception intoError. Reuse the
existing collection and classification logic, preserving breadth-first
ordering through nested boundaries, duplicate classes, and I/O origins.
Route the exception predicates through that shared classification path. -
simplify borrowed error inspection
Expose semantic predicates on
ExnandErrorso callers can classify
failures without downcasts or ownership-consuming conversions. Preserve
explicit retry markers as distinct from the I/O retry policies.Make nested error lookup follow logical breadth-first order and add
borrowedExn::probable_cause(). Distinguish native-source identities even
when a source shares its owner's address, preserving the selected cause
through conversion. Reuse the existing inspection collectors.Consolidate representation-independent helpers and document conversions
that retain context and caller locations.
Bug Fixes
-
preserve classifications in custom I/O payloads
std::io::Error::source()skips its custom payload, hiding classification
markers, custom error types, and branches of a nestedgix_error::Error.
Retain the payload while walking native sources so borrowed retry policies,
exception traversal, and both porcelain error modes see the complete cause.Document how custom errors expose their immediate cause and classification
markers. Cover every classification, nested branches, and concrete payload
downcasts, and update diagnostic snapshots for the retained I/O payload. -
render nested error causes once
Rendering a nested
Errorinvoked its complete formatter before expanding
its causes again, duplicating messages and mixing formatting modes. Render
the concrete root once and skip that exact root during nested expansion;
its position is not necessarily first after filtering nested boundaries.
Apply the selected formatting mode and caller locations to nested causes. -
keep drained exceptions safe to inspect
Converting a typed
Frameinto a bareExnleft its error box typed while
error(), dereferencing, and extraction expectedUntyped, causing a
panic afterdrain_children(). Wrap typed roots during the shared frame
conversion while retaining existing erasure, sources, and child frames.
Changed (BREAKING)
-
unify diagnostics as
Messageand preserve causesI refackiewed gix-error with the usual care, and skimmed through all the
downstream changes, rubber-stamping it.
Definitely cleaned up a few bits, like config-key related error handling,
and error related types.A single failure could require separate errors for its message, category,
and diagnostic values. Classification wrappers could obscure the concrete
cause, while cause-selection heuristics could choose a different sibling
after adding context or flattening an exception tree. Represent each
failure with one diagnostic and preserve its actual causal structure.Make
Messagethe shared diagnostic type, with a message, optionalClass,
and namedMetadataValues. Classified constructors and thewith_class()
andwith()builders attach categories and details without extra error
layers. Plain messages and string conversions remain unclassified.
Metadatais now the value dictionary;Exn::metadata()and
Error::metadata()yield only non-empty dictionaries in traversal order,
keeping each context separate and preserving bytes, paths, and numeric types.Introduce
ClassificationMarkerto classify existing concrete errors or
provide classification-only sources. Classification still inspects these
markers, while diagnostic traversal, downcasts, cause selection, and
reports skip them and retain their real descendants. Preserve concrete
I/O errors and their original kinds for recovery decisions.Give
Frame,Exn, andErrorthe sameprobable_cause()policy: follow
the unique causal path to a leaf or the first diagnostic branch, retaining
the aggregate instead of choosing an arbitrary sibling. Include native
sources, I/O payloads, nested errors, and explicitly raised children in both
tree and chain representations. Preserve caller locations through transparent
markers, avoid duplicate native causes in reports, and honor alternate
TestErrorformatting. Marker-only errors retain a classification fallback.Add
ExnResult<T = (), E = exn::Untyped>andExnMessageResult<T = ()>,
re-export them fromgix, and adopt them throughout the workspace. Keep
callback bounds erased and preserve concrete error types where callers
need their payloads. Group supporting classification and display types in
gix_error::types, and frame inspection and erasure ingix_error::exn.Migrate constructors, signatures, and recovery checks together. Replace the
gix::config::key::Errorfamily with ordinary diagnostics and central
gix::Errorresults. Provideconfig::key::error()anderror_with_value()
forkey, optionalenvironment_override, and optionalinputmetadata.
Retain parser causes, rejected numeric values, accepted special values,
and configuration leniency. Collapse artificial error layers elsewhere
while preserving concrete failures and partial outcomes.Make complete diagnostics reviewable through inline
instasnapshots,
retaining assertions for classifications, retry policies, concrete causes,
and stored data. Use the shared snapshot redaction helper for unstable
paths, ports, object IDs, and platform-specific OS errors. Update migration
guidance, examples, and CLI snapshots, and use static X.509 assertion messages to
avoid dumping verifier identities and raw output. -
raise MSRV to Rust 1.88
The newly published
dua-core3.3 release used by linked-worktree removal
requires Rust 1.88, so raise every workspace crate and the advertised badge
together.Keep the MSRV checks buildable by selecting the latest
sysinfoandrusqlite
release lines that support Rust 1.88.
New Features (BREAKING)
-
expose structured error classifications
Marked breaking becausecan_retry()now has a much more conservative default.
So downstream has to adjust and usecan_retry_lenient()if this is desired.Add ordered, non-exclusive classifications that retain the concrete error
source. Resource exhaustion now distinguishes configured allocation limits
from allocation or capacity failures, while existing boolean helpers remain
compatibility views.
Commit Statistics
- 15 commits contributed to the release over the course of 24 calendar days.
- 24 days passed between releases.
- 11 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Merge pull request #2847 from GitoxideLabs/gix-error-completion (6356013)
- Unify diagnostics as
Messageand preserve causes (da0f21d) - Attach scalar metadata to error contexts (dcdddd9)
- Inspect borrowed error classifications lazily (82776d9)
- Preserve classifications in custom I/O payloads (ac88bd7)
- Merge pull request #2989 from GitoxideLabs/error-conversion-review (4b9ff51)
- Expose borrowed exception retry policies (4fa58c5)
- Expose borrowed exception classifications (ef8ced5)
- Render nested error causes once (ca0f05d)
- Keep drained exceptions safe to inspect (c28e494)
- Simplify borrowed error inspection (ce38e3b)
- Merge pull request #2949 from GitoxideLabs/error-conversion-review (a095334)
- Expose structured error classifications (b7ebd86)
- Raise MSRV to Rust 1.88 (4b42e0c)
- Merge pull request #2955 from GitoxideLabs/transport-url-encoding (7e35849)