[Lazarus] Exception dialog

Martin Friebe lazarus at mfriebe.de
Tue Mar 17 16:39:55 CET 2009


Michael Van Canneyt wrote:
> On Tue, 17 Mar 2009, Martin Friebe wrote:
>   
>>> To reject the current value of the field from the OnValidate event
>>> handler, raise an exception.
>>>
>>>   
>>>       
>> Then to me the Delphi/Kylix implementation is flawed. Because it forces 
>> me to do TWO things, even if I want to do only one of them.
>> There should be:
>> - an ExceptionClass TDataValitaionException (or whatever) which can be 
>> used to abort writing the data, but not defer error handling to the mainloop
>> - any other exception, that aborts the write, and transfers error 
>> handling to the main loop
>>
>> There are usages for both scenarios, so they should both be possible.
>>     
>
> This may be so, but given the implementation as it is in Delphi, 
> hopefully you can now understand my problem with the Lazarus
> exception dialog :-)
>
>   
Yes, and no:

Yes I can, if you leave those exception to be handled by the build-in 
dialog.
  Which means that you do not intend to provie any helps or options to 
the user, but only want to display the message and leave it to the user.

No,
 because IMHO you still want to handle it in OnException or similar, and 
it would therefore be easy to write your own MessageDlg

 leaving it to the build-in means you assume it is *impossible* that any 
other exception can ever occur in your app, and also end up with the 
same dialog => because if that happens, the user of your application has 
no way to tell, which of the exceptions are "ok" ; and which indicate 
that the app just had an internal crash and will now be unstable and 
data may be lost


In other words: I believe the build-in dialog should feature the text: " 
The application has just crashed. You may press continue and try to save 
any data before you quit the application."

Best Regards
Martin




More information about the Lazarus mailing list