4 ms·
Like the sibling, I'm not sure if you are serious, but my library SNAFU (https://docs.rs/snafu/0.6.0/snafu/ https://docs.rs/snafu/0.6.0/snafu/) is similar to th
by shepmaster 7y ago
Like the sibling, I'm not sure if you are serious, but my library SNAFU (https://docs.rs/snafu/0.6.0/snafu/ https://docs.rs/snafu/0.6.0/snafu/) is similar to this at a step or two higher level. The idea is that you wrap lower-level errors (a file system error) with a higher-level context (opening the config file).
Taken to the extreme, you have a unique context for every possible error source inside your library, which means you could directly search for the name to find the line number.
This does make me wonder how I could add line / file information to an error automatically though.