Skip to content

Releases: jamesgober/error-forge

Error Forge v0.9.6-beta — Stable Pre-Release

17 Aug 16:41

Choose a tag to compare

A near-1.0 cut with async-first hooks and enhanced error recovery across the board—building on the 0.9 line’s stabilized trait, macros, and composition model. If you’ve been waiting for async observability and safer, guided recovery paths, this release is for you. (See 0.9.0 pre-release notes for the core feature set and context.) ([GitHub]1)


What’s new in 0.9.6

Async support (hooks & helpers)

  • Async error hooks: register asynchronous callbacks for routing and enrichment (log/telemetry sinks, remote reporters, queues) without blocking the hot path. The new async APIs live alongside the existing sync hooks, so you can mix and match per deployment needs.
  • Async context propagation: attach key-value context to an error and await a hook pipeline that can augment or redact fields before final handling.
  • Non-blocking severity routing: high-severity events (Error/Fatal) can be escalated via async pipelines while normal flow proceeds—great for latency-sensitive services.

Background: Error Forge already provides rich errors, macros, composition, console formatting, and severity-based hooks; 0.9.6 makes those hooks first-class async. ([GitHub]2)

Enhanced error recovery

  • Recovery helpers: ergonomic combinators to retry, fallback, or rescue with structured backoff (fixed, exponential, jitter). Recovery decisions can key off severity, code, or domain metadata.
  • Outcome typing: helpers return clear Recovered / Escalated outcomes so you can keep recovery logic pure and auditable.
  • Composability: chain recovery rules per module (e.g., Storage vs. Network) without losing context or backtraces.

Still here from the 0.9 line

  • Stabilized core trait: unified ForgeError with contextual metadata, severities, and stable codes—easy to map into protocols. ([GitHub]1)
  • Ergonomic macros: define_errors! and #[derive(ModError)] to generate complete, well-formed error enums. ([GitHub]1)
  • Error composition with group! for large workspaces. ([GitHub]1)
  • Optional console theming via ConsoleTheme for CLIs. ([GitHub]2)

Feature flags (suggested)

  • hooks – enable hook registries (both sync and async).
  • ansi-console – colorized terminal formatting.
  • serde – serialize errors/metadata for transport.
  • backtrace – include backtraces when the toolchain supports it. ([GitHub]1)

Compatibility & migration notes

  • Non-breaking for 0.9 adopters: existing sync hook APIs remain.
  • New async hook APIs are additive; adopt incrementally per module.
  • Recovery helpers are opt-in; you can keep using your own retry logic and introduce Forge’s combinators where they add clarity.

Example snippets (illustrative)

Register an async hook

// pseudo-API names for illustration
error_forge::hooks::register_async(|evt| async move {
    if evt.severity().is_error() {
        telemetry::send(evt).await.ok();
    }
});

Recover with backoff

use error_forge::recovery::{retry, backoff};

let op = || async { do_io().await.map_err(MyError::from) };

let result = retry(op)
    .when(|e| e.domain() == Domain::Net)
    .backoff(backoff::expo().jitter())
    .max_retries(5)
    .run()
    .await;

(Names shown reflect intent; check crate docs for exact symbols.)


Roadmap

  • Localization (planned): localized captions and field formatting (ICU-style message strings, locale-aware Display), plus language packs and a compile-time or runtime bundle loader.

Install / Upgrade

[dependencies]
error-forge = "0.9.6-beta"
# optional features
# error-forge = { version = "0.9.6-beta", features = ["hooks","ansi-console","serde","backtrace"] }

CI & quality

  • Cross-platform CI (Linux/macOS/Windows) is being expanded; please report platform quirks.
  • Great places to contribute: async hook adapters, recovery recipes, and macro docs.

Thanks

Thanks to early adopters who asked for async observability and safer recovery primitives—this release ships those without compromising the lean core.

Changelog reference: see the 0.9.0 Stable Pre-Release notes for the stabilized surface and original highlights. ([GitHub]1)

Full Changelog: v0.9.0...v0.9.6

Stable Pre-Release

17 Aug 15:45

Choose a tag to compare

Stable Pre-Release Pre-release
Pre-release

Error Forge v0.9.0-beta — Stable Pre-Release

A near-1.0, production-aimed cut of Error Forge with a stabilized core trait, ergonomic macros, and hookable reporting. This is a compatibility lock ahead of 1.0—please kick the tires and report anything that blocks your use in real systems.

Highlights

  • Stabilized core: a unified ForgeError interface for rich, structured errors with context metadata and easy transport mapping.
  • Ergonomic macros: define_errors! and #[derive(ModError)] generate complete, well-formed error enums with minimal boilerplate.
  • Composition across modules: group! lets you aggregate error families cleanly in large workspaces.
  • Hooks with severity: register callbacks to observe/route errors by severity (e.g., warn/error/fatal) without coupling to a logging backend.
  • Console theming: optional ANSI color formatting via ConsoleTheme for readable terminals; keep structured text where you prefer.
  • Cross-platform focus: repository prepared for CI on Linux, macOS, and Windows.

What’s in this release

  • ForgeError trait (stabilized)
    Expressive display + std::error::Error impls, contextual key-value metadata, severity, and stable codes for mapping to protocols (HTTP/gRPC/custom).

  • Macros & derives

    • define_errors! — declare rich error enums with per-variant messages and fields.
    • #[derive(ModError)] — fast path to wire an enum into ForgeError.
    • group! — compose multiple error enums under a single umbrella.
  • Hooks API
    Register zero-cost callbacks for specific severities (e.g., send ERROR+ to your logger/telemetry, suppress DEBUG in prod).

  • Console formatting (feature-gated)
    Pretty, colorized human output for CLIs while keeping machine-readable formatting available.

Feature flags (recommended defaults)

  • ansi-console – enable ConsoleTheme ANSI styling for terminals.
  • serde – (when enabled) serialize error payloads/metadata for transport or snapshots.
  • hooks – enable the global hook registry.
  • backtrace – (if supported in your toolchain) capture/print backtraces for deep debugging.

Keep the library lean: all “nice-to-haves” are opt-in so you can ship tiny binaries.

Examples

Define a module error and add context/hook:

use error_forge::{define_errors, ForgeError, Severity};

define_errors! {
    #[derive(Debug)]
    pub enum StorageError {
        #[error("disk full at {path}")]
        DiskFull { path: String },

        #[error("permission denied")]
        PermDenied,
    }
}

fn main() {
    error_forge::register_hook(|e| {
        if e.severity() >= Severity::Error {
            eprintln!("ERR[{}]: {}", e.code(), e);
        }
    });

    let err = StorageError::DiskFull { path: "/var".into() }
        .with("node", "n1")
        .with("op", "write");
    // return Err(err)
}

Install / Upgrade

[dependencies]
error-forge = "0.9.0-beta"
# optional
error-forge = { version = "0.9.0-beta", features = ["ansi-console","hooks","serde","backtrace"] }

For maintainers/contributors

  • Cross-platform CI matrix is being finalized (Linux/macOS/Windows).
  • Fuzz and doc tests welcome—focus on macro hygiene, hook safety, and backtrace behavior.

Thanks

Huge thanks to early adopters who pushed for better composition patterns and cleaner console output—you shaped this release.

Full Changelog: v0.6.3...v0.9.0

v0.6.3 Alpha

17 Aug 13:34

Choose a tag to compare

v0.6.3 Alpha Pre-release
Pre-release

Pre-Release backup

Stable Pre-Release

30 Jul 07:16

Choose a tag to compare

Stable Pre-Release Pre-release
Pre-release

Error Forge 0.6.3 Stable Pre-Release

This release focuses on documentation improvements, API enhancements, and critical fixes to ensure compatibility with docs.rs and other tooling. Error Forge is now ready for production use in your Rust applications!

Key Features & Improvements

Enhanced Error Hook System

  • Added ErrorLevel enum with severity levels: Info, Warning, Error, and Critical
  • Introduced ErrorContext struct with caption, kind, severity level, fatality, and retryability information
  • All error creation points now provide rich context for external logging systems

Documentation Enhancements

  • Complete API documentation with detailed examples in API.md
  • Comprehensive README with installation and usage guides
  • Fixed doctest issues in the derive macro crate
  • Properly configured docs.rs build settings

Serialization Support

  • Added proper serde serialization support for error types
  • Correctly handles non-serializable fields like io::Error with skip attributes

Bug Fixes

  • Resolved CI/doctest issues with the derive macro
  • Fixed docs.rs build failures
  • Improved compatibility with external logging systems

Using This Release

This pre-release is considered stable for production use. Include it in your projects with:

[dependencies]
error-forge = "0.6.3"

 

Full Changelog: 0.6.1...0.6.3

Stable Pre-Release

30 Jul 05:05

Choose a tag to compare

Stable Pre-Release Pre-release
Pre-release

Full Changelog: 0.2.0...0.6.1

First stable release.

0.2.0 Pre-Releasse

29 Jul 20:21

Choose a tag to compare

0.2.0 Pre-Releasse Pre-release
Pre-release
  • Not recommended for use yet.