Modular Errors in Rust
What I’m here to convince you of today is that this principle applies additionally to error types: that is, error types should be located near to their unit of fallibility. To illustrate this point, I will follow the initial development and later API improvement of a hypothetical Rust library.
Source: Modular Errors in Rust, an article by Sabrina Jewson.