3 ms·
Trying to understand your point. If you try to open a file or a network connection or divide by zero, you don't handle any exception in that calling function, b
by gunapologist99 4y ago
Trying to understand your point. If you try to open a file or a network connection or divide by zero, you don't handle any exception in that calling function, but instead let them propagate all the way to the top?
- papito 4y agoWhat are you going to do with that? Keep returning errors until the calling function gets the error? That's what exceptions do for you. Do you have any guarantee that there is no bug in the error-handling code somewhere? And what will be the final result of the error? An error screen, right? That's presentation layer. Any fatal error should halt execution, be thrown to the top, and manifest itself as a message in the presentation layer, right? Throwing an error is not "not handling it"!