- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
This is not as bad as it looks. When running in a debugger, the debugger can stop on the 'frist-chance-exception'. There you can read the informative exception message.
/s
Admin
Not an honourable mention of the appalling indentation practices?
Admin
Correction: the child first stabs the ball to let all the air out, leaving a limp piece of rubber which is useless for playing.
i.e., ignoring the actual information in "e" and simply throwing a constant string, so that in the best case, someone will know that something went wrong, but not have any idea what happened or where.
Admin
“There is a theory which states that if ever anyone discovers exactly what the Exception is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened.”
Admin
Don't forget the parameter in the JavaDoc that's not part of the signature.
Admin
ON ERROR RESUME NEXT
Admin
It's equally as bad.
Admin
Ah, the good old "$ ON ERROR THEN CONTINUE" from my days writing DCL command procedures on VMS . . . good times, good times.
Admin
[Quote giammin]ON ERROR RESUME NEXT[/Quote] With higher memory requirements.
Admin
This is why XML is bad!
Admin
Not really. Nothing about XML mandates handling exceptions in a really WTF way. Also, the method of scanning through the data is a WTF with any recursively defined data format. It would be just as much a WTF if it were JSON or YAML.
Admin
That's what really drives me bonkers: the exception message that explains nothing.
Admin
Use a first chance exception handler as a logger.... then this pattern makes perfect sense....
First Chance Exception loggers are often wired into other systems. For example, one NOC I was involved with would examine any first-chance exception and if it was not on a "white-list" (location and content) then it would generate a ticket. Depending on the module/stack trace this could start to set of a whole chain of people being woke up in the middle of the night.
The developers were careful to ensure that "Exceptions were exceptional" and diligently pre-did all error checks for things with rates of occurances above a few ppm.... it was some of the best written code I have seen in 30 years of C++ development.
Admin
So this basically is what you get for checked exceptions, amirite lol
Admin
I don't use .NET currently, so I may be wrong on this ...
But wouldn't a first-chance exception handler be triggered when the outer try block throws an exception - before execution goes to that wonky catch block with its own thrown and caught exception?
Admin
This is not .net code, it's Java ;-)
Admin
Some knows his classics :-)
Admin
When some code that I call throws exceptions, I will definitely want to know what exceptions and why (for example because I do something wrong calling the code). So at the very least I check which exceptions, ignore the ones that I know can be ignored, and make sure that I get notified if any exceptions arrive that I haven’t seen before.