5 ms·
I'd expect 'on_error' to take a function as a callback, not a string. But yes, a better named function could be added
by eximius 9y ago
I'd expect 'on_error' to take a function as a callback, not a string. But yes, a better named function could be added
- skybrian 9y agoPerhaps or_die, similar to Perl?
- sanderjd 9y agoYep, this is what I always wanted it to be! But maybe or_panic would be better. Naming things is hard.
- eternalban 9y agoexpect[ing_error]("could not open the file")
- rootlocus 9y agoYou're not expecting an error. On the contrary, you're expecting a value or throwing an error.
- eternalban 9y agoYou're expecting specific errors.
- allan_s 9y agoor_fail_with("") ?