3 ms·
The error can't go through a function that doesn't return an error, unlike exceptions. Also, you have to ask for this. Reversing the default is a big difference
by tedunangst 7y ago
The error can't go through a function that doesn't return an error, unlike exceptions. Also, you have to ask for this. Reversing the default is a big difference.
- deleted 7y ago[deleted]
- nmadden 7y agoUnlike unchecked exceptions.
- tedunangst 7y agoEven with checked exceptions, you have to be careful. You may not want exceptions from every function you call to fly up to the caller. function X() throws Oops { okToFail(); // fine if this failure goes up unexpectedFailure(); // not fine to go up } Unfortunately, once you tell the compiler its ok for exeptions to go up, that rule applies to the whole function.
- nmadden 7y agoI’m sure that’s a common problem.