Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
eximius
8y ago
0 comments
Share
I'd expect 'on_error' to take a function as a callback, not a string. But yes, a better named function could be added
0 comments
default
newest
oldest
skybrian
8y ago
Perhaps or_die, similar to Perl?
sanderjd
8y ago
Yep, this is what I always wanted it to be! But maybe or_panic would be better. Naming things is hard.
allan_s
8y ago
or_fail_with("") ?
eternalban
8y ago
expect[ing_error]("could not open the file")
rootlocus
8y ago
You're not expecting an error. On the contrary, you're expecting a value
or
throwing an error.
eternalban
8y ago
You're expecting specific errors.
j
/
k
navigate · click thread line to collapse