Possibility of adopting Rust's Error Handling?

Paulo Pinto pjmlp at progtools.org
Fri Apr 1 06:17:53 UTC 2022


On Thursday, 31 March 2022 at 21:21:04 UTC, mee6 wrote:
> Rust's error handling is pretty good, I think they've proved 
> the use of Result!(T, E)....

It has some warts still, that is why packages like these exist,

https://docs.rs/thiserror/latest/thiserror/

https://docs.rs/anyhow/latest/anyhow/

To work around the boilerplate and lack of support in standard 
library when combining errors from different libraries.

Rust still suffers from a npm like approach to stuff that should 
be part of the standard library for basic stuff, error 
definition, async runtimes, serialization,...


More information about the Digitalmars-d mailing list