3 ms·
Failing the task isn't the standard way to handle errors; propagating information via the Result type (especially the try! macro) is more conventional, as it al
by dbaupp 12y ago
Failing the task isn't the standard way to handle errors; propagating information via the Result type (especially the try! macro) is more conventional, as it allows the caller to handle the problem, failing is very annoying to recover from.
- http://doc.rust-lang.org/nightly/std/result/ http://doc.rust-lang.org/nightly/std/result/
- http://doc.rust-lang.org/nightly/std/result/#the-try!-macro http://doc.rust-lang.org/nightly/std/result/#the-try!-macro
- Argorak 12y agoI didn't make that clear enough: I should have qualified by "if the error is indeed fatal at that point". In the example script, it really doesn't make sense to go on after that.