[Lazarus] Exception dialog

Hans-Peter Diettrich DrDiettrich1 at aol.com
Mon Mar 16 23:42:04 CET 2009


Michael Van Canneyt schrieb:

> Is there a reason why the default exception dialog has a cancel 
> button to kill the application ?

An unhandled exception IMO is due to some software bug, which the user 
cannot cure in any way.

> We often use an exception to signal wrong entry of data or so, 
> because it stops all further processing.

That's okay, if you also implement appropriate exception handling. 
Exceptions are fine in error situations, that cannot be cured at the 
place of their occurence. It's up to the program designer to find the 
best place for handling every intentional exception.

> If the user then uses the cancel button, the program is simply 
> ended, which is not what we (or better: the users) want.
> And I imagine many others use this technique.

No, hopefully not :-(


> I have overridden the OnException handler of TApplication, 
> so it's no longer a problem, but I was curious as to why this
> is done like this by default ?

Insert your exception handler in an more appropriate place, depending on 
the concrete application. The user can expect a diagnosis of what went 
wrong, and a chance for correcting his preceding input.

DoDi




More information about the Lazarus mailing list