(no title)
jimis | 5 years ago
- You bubble up errors using `?` operator,
- then you get a nice error message.
- However the location of the error is lost, the more complex the program, the harder it is to figure out where "permission denied" for example comes from.
jandrese|5 years ago
nivenkos|5 years ago
It's only really a pain when writing libraries as you have to be so specific about your error types, etc.
Overall, it's probably still the "least bad" option compared to other languages' approaches (both Go and Python are painful for this for example). But it can be a lot of extra work sometimes, especially when just working on the first basics of a library crate.
magicalhippo|5 years ago
I'd say you should attach context.
If there's problems accessing a file, then having an error message without the filename in it is near useless.