github GitoxideLabs/gitoxide gix-error-v0.4.0
gix-error v0.4.0

7 hours ago

New Features

  • attach scalar metadata to error contexts

    Callers can enrich errors with named values they already possess without
    introducing a custom payload type. Metadata keeps 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 with Error and Exn. The shared traversal and predicate definitions
    remove more code than the borrowed API adds. Keep probable_cause() unchanged.

  • expose borrowed exception retry policies

    Add Exn::can_retry() and Exn::can_retry_lenient() using the existing
    classification and retry rules. Callers can now inspect retry policies
    without consuming an exception to produce Error.

    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 into Error. 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 Exn and Error so 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
    borrowed Exn::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 nested gix_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 Error invoked 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 Frame into a bare Exn left its error box typed while
    error(), dereferencing, and extraction expected Untyped, causing a
    panic after drain_children(). Wrap typed roots during the shared frame
    conversion while retaining existing erasure, sources, and child frames.

Changed (BREAKING)

  • unify diagnostics as Message and preserve causes

    I 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 Message the shared diagnostic type, with a message, optional Class,
    and named MetadataValues. Classified constructors and the with_class()
    and with() builders attach categories and details without extra error
    layers. Plain messages and string conversions remain unclassified.
    Metadata is 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 ClassificationMarker to 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, and Error the same probable_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
    TestError formatting. Marker-only errors retain a classification fallback.

    Add ExnResult<T = (), E = exn::Untyped> and ExnMessageResult<T = ()>,
    re-export them from gix, 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 in gix_error::exn.

    Migrate constructors, signatures, and recovery checks together. Replace the
    gix::config::key::Error family with ordinary diagnostics and central
    gix::Error results. Provide config::key::error() and error_with_value()
    for key, optional environment_override, and optional input metadata.
    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 insta snapshots,
    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-core 3.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 sysinfo and rusqlite
    release lines that support Rust 1.88.

New Features (BREAKING)

  • expose structured error classifications
    Marked breaking because can_retry() now has a much more conservative default.
    So downstream has to adjust and use can_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 Message and 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)

Don't miss a new gitoxide release

NewReleases is sending notifications on new releases.