Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
eximius
9y ago
0 comments
Save
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
6 comments · 3 top-level
top
newest
oldest
eternalban
9y ago
· 2 in thread
expect[ing_error]("could not open the file")
rootlocus
9y ago
You're not expecting an error. On the contrary, you're expecting a value
or
throwing an error.
eternalban
9y ago
You're expecting specific errors.
skybrian
9y ago
· 1 in thread
Perhaps or_die, similar to Perl?
sanderjd
9y ago
Yep, this is what I always wanted it to be! But maybe or_panic would be better. Naming things is hard.
allan_s
9y ago
or_fail_with("") ?
j
/
k
navigate · click thread line to collapse