Skip to main content

Crate error_path

Crate error_path 

Source
Expand description

error-path adds stable, structured operational addresses to Rust errors.

The crate is intentionally tiny:

  • WithErrorPath is the compatibility trait used by macros.
  • ErrorPath is a structured operational address.
  • Optional features adapt anyhow, eyre, error-stack, and stacked_errors.

§Example

use error_path::ErrorPath;

let mut error_path = ErrorPath::from_segment("http.0405");
error_path.prepend_path("login.api.request_login");

assert_eq!(error_path.to_string(), "login.api.request_login.http.0405");

Structs§

ErrorPath
A structured operational error address.

Enums§

SetPathDelimiterError
Error returned when the process-wide path delimiter cannot be configured.

Traits§

ErrorPathExt
Read a structured operational address from an error.
WithErrorPath
Compatibility trait used by the generated macro code.

Functions§

path_delimiter
Return the process-wide path delimiter.
set_path_delimiter
Set the process-wide delimiter used by ErrorPath Display.