[Lazarus] Exception dialog

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Mar 17 15:25:25 CET 2009


On Tue, Mar 17, 2009 at 3:46 PM, Martin Friebe <lazarus at mfriebe.de> wrote:
> Anyway, the point is, if we are looking at the original source of the
> discussion (the build-in exception dialog) => that is at best the most
> limited case of handling an exception (It is simply displaying it). It
> does not check any need for cleanup, or other actions, or user-help
> ...... So then you would want to use Application.OnException or similar.

In the case of the TField.OnValidate, I tend to agree with you. I
would image that to stop the system from writing data to the db you
need to raise a more specific exception like a custom
EMyAppValidationError instead of simply Exception. That way you can
display it correctly in the Application.OnException with a simple OK
button. Anything else "unknown" can use the default dialog - which
signifies that the system is now in a possible unstable state. For the
latter,  application termination is probably the best choice for the
user.

Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list