View Single Post
Old 01-22-2004, 08:15 PM   #5 (permalink)
Quadraton
Addict
 
Location: Ottawa, ON, Canada
That's a good point, but my opinion is that letting an unhandled exception fall through serves no purpose whatsoever. The system doesn't tell you where that unhandled expection occured, either in the error box (Windows), or the core dump (UNIX/Linux), or that it was even an unhandled exception that caused the program to crash in the first place. If anything, you can always just do the following:

Quote:
catch( ... )
{
    printf( "Abnormal termination: Unhandled exception in main()" );
}
or write the error to a log file, or to sterr, or whatever.

In the end, I guess it's up to the developer to make the decision, but experience has taught me that unhandled exceptions that fall through can be a headache to debug. And ideally, a well written piece of code should have a catch() for all thrown exceptions, but this method handles the 'just in case".
__________________
"A witty saying proves nothing"
- Voltaire

Last edited by Quadraton; 01-23-2004 at 12:35 PM..
Quadraton is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62