#error #context

error-context

Methods and types that help with adding additional context information to error types

3 releases

0.1.2 Aug 27, 2019
0.1.1 Apr 11, 2019
0.1.0 Feb 18, 2019

#927 in Rust patterns

Download history 12/week @ 2021-06-03 12/week @ 2021-06-10 15/week @ 2021-06-17 15/week @ 2021-06-24 17/week @ 2021-07-01 32/week @ 2021-07-08 23/week @ 2021-07-15 10/week @ 2021-07-22 20/week @ 2021-07-29 25/week @ 2021-08-05 16/week @ 2021-08-12 9/week @ 2021-08-19 5/week @ 2021-08-26 1/week @ 2021-09-02 14/week @ 2021-09-09 8/week @ 2021-09-16

55 downloads per month
Used in 8 crates (3 directly)

MIT license

18KB
298 lines

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.

No runtime deps