Thursday, February 15, 2007

try / catch issue.

I have seen that you are sometimes using try blocks with empty catch() handlers.

Please don’t do it like this.

In last years we have also done it like that, but ‘hiding the symptoms is not the cure to the disease’

In any case, if something goes wrong, use the trace facilities in application to log something to the errlog.

And additionally you can use ASSERT(FALSE) statements to force a break into the debugger in debug builds.

 

Or you can leave the try catch altogether. The user then will get a crash dump he can send to us for further analysis.

 

No comments: