Registry / utility / fn-error-context

fn-error-context

JSON →
library0.2.1rscratesunverified

An attribute macro to add context to errors from a function.

# Cargo.toml [dependencies] fn-error-context = "0.2.1"
INSTALL
IMPORT
SIG · FN-ERROR-CONTEXT
F
fn-error-context
utilityrustv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

context
use fn_error_context::context;

Adds error context to a function using an attribute macro.

use fn_error_context::context; #[context("Failed to process input")] fn process(input: &str) -> Result<(), String> { if input.is_empty() { Err("empty input".to_string()) } else { Ok(()) } } fn main() { process("").unwrap_err(); // Error includes context }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.2.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
fn-error-context — cargo add fn-error-context · libregistry