Board index » delphi » Replace Exception messages for customized messages

Replace Exception messages for customized messages

Dear Friends, I have a portion of code that update a cache update query,
but when an exeception occurs
I need avoid the original message and replace it with a customized
message, How can I do that?

This is the code, but first the original message appears and then the
message created with 'raise'
appears, how do I delete the first message.

 if not dbPrestamo.InTransaction then
   begin
     try
        {Postea las actualizaciones pendientes a la base de datos}
       dbPrestamo.Applyupdates([qryPrestamo]);
       DbiSaveChanges(qryPrestamo.Handle);
     except
           {Si ocurre un error genera mensaje de excepcin}
           raise EDatabaseError.Create('The record was deleted or
modified by another user');
     end;
   end

Regards

  rmartine.vcf
< 1K Download
 

Re:Replace Exception messages for customized messages


Quote
>This is the code, but first the original message appears and then the
>message created with 'raise'
>appears, how do I delete the first message.

That should only be what you see in the IDE.  When run outside the IDE you
should only see your custom error.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads