Error handling
FranklinChen opened this issue · 2 comments
Are there any plans to provide standard layers of error handling mechanism for Rust over raw Result
, or any interest in contributions? For example, I have hand-rolled a specialized equivalent of Scala/Haskell idiomatic validation for my own use, in which I accumulate errors in a Result<T, Vec<E>>
(using another monoid is of course possible).
You might have a look at the error interoperation RFC, which has essentially been accepted (modulo some final details). I suspect that doesn't completely cover what you have in mind, though.
What the RFC does do, though, is start treating errors as a first-class concept in Rust's standard library, by introducing an Error
trait. The library support around this trait will likely grow over time.
In general, now that we have Cargo, we prefer for this kind of thing to be started as a public, experimental Cargo crate. If it appears widely useful/used over time, then we'll bring it into the "official" standard library.
Thanks, I will study the discussions and see if there is someone's project I can contribute to, or put up my own.