2004-02-18 07:16:40 PM delphi281
Hello,
In try/except block we can catch exceptions. This could be any exception. How can I show a user friendly message instead of default exception message.
Thanks.
In try/except block we can catch exceptions. ...
How can I show a user friendly message ...
It is easy. Do something like this:
Try
...
Except
on e: EDatabaseError do ShowMessage
('My database error: '+e.Message);
on e: EConvertError do ShowMessage
('A conversion error: '+e.Message);
{otherwise, let the exception fall through
to be caught in outer block}
End;
Rgds, JohnH
John Herbster (TeamB)
Delphi Developer
2004-02-18 08:30:28 PM
Re:try/except
PS: You question should have been posted in
"borland.public.delphi.language.delphi.general"
--JohnH