error-context 0.1.2

Methods and types that help with adding additional context information to error types
Documentation
  • Coverage
  • 51.85%
    14 out of 27 items documented1 out of 21 items with examples
  • Size
  • Source code size: 19.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.59 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jpastuszek/error-context
    3 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jpastuszek

Latest Version Documentation License

Aim of this library is to provide convenient way of adding statically typed context information to errors in Rust.

This crate provides two ways of adding context:

  • to new error types by means of WithContext trait,
  • to existing errors by wrapping in ErrorContext type and converting to your type using From trait.

It provides extension methods for Result type as well as some free functions to help with adding context.

For examples and usage see crate documentation at docs.rs.

If you are looking for more dynamic way of adding context to error messages see problem crate.