Re:Overview of Rust error handling libraries
by cesarb on Friday November 22, 2019 @01:44PM
(#21608599)
> If my application spits out "IO error: nonexistent file", I need to know which line it came from to know which file it's talking about.
Last time I needed this, I created a simple ErrorWithPath<E> wrapper around Error which also stores the path as a String, and a helper function which calls a closure and wraps any errors on its result with that wrapper. (If you want to take a look, it's at https://github.com/cesarb/filestatrec/blob/master/src/error....)
Last time I needed this, I created a simple ErrorWithPath<E> wrapper around Error which also stores the path as a String, and a helper function which calls a closure and wraps any errors on its result with that wrapper. (If you want to take a look, it's at https://github.com/cesarb/filestatrec/blob/master/src/error....)