Releases: jamesgober/error-forge
Error Forge v0.9.6-beta — Stable Pre-Release
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
ForgeErrorwith 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
ConsoleThemefor 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
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
ForgeErrorinterface 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
ConsoleThemefor 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
-
ForgeErrortrait (stabilized)
Expressive display +std::error::Errorimpls, 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 intoForgeError.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– enableConsoleThemeANSI 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
Pre-Release backup
Stable 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
ErrorLevelenum with severity levels:Info,Warning, Error, andCritical - 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
Full Changelog: 0.2.0...0.6.1
First stable release.
0.2.0 Pre-Releasse
- Not recommended for use yet.