3 ms·
Saying exceptions are for exceptional situations is an old fallacy (one I used to believe in). Exceptions are errors. Errors happen all the time. They are not
by NateDad 12y ago
Saying exceptions are for exceptional situations is an old fallacy (one I used to believe in). Exceptions are errors. Errors happen all the time. They are not exceptional.
- WorldWideWayne 12y agoSure they are. Just because something happens all the time doesn't mean that it's not exceptional. Banks get robbed all the time, but that's still the exception to the rule that people usually go to the bank for normal business. At the "Bank of Golang" though - they've made every customer get strip searched on their way in because of something that happens 1% of the time. No thanks. I'd rather go across the street where they simply have some cameras and security guards watching the crowd for exceptional behavior.
- frowaway001 12y agoThat's utter non-sense. There is slight difference between "the database is on fire" and "a user with user id 42 couldn't be found in the database", don't you think? Go handles neither of these situations gracefully.
- vardump 12y agoLet me guess, it logs something somewhere that no one ever checks? Or equally likely, you'll find this: void SomeHighLevelMethod() { ... catch (const DatabaseOnFireException& e) { // TODO log something here // TODO do something here } ... }