Swallowed Exceptions: Not Just for Java

| No Comments

Did I mention swallowed exceptions are evil?

Well, guess what I found in PL/SQL triggers all over the place?

CREATE OR REPLACE TRIGGER  TR_FOO
 BEFORE INSERT ON FOO
 FOR EACH ROW
DECLARE
 bla NUMBER;
BEGIN
   bla := 0;

   SELECT -- [etc., etc.]

   EXCEPTION
     WHEN OTHERS THEN
       Null;

END TR_FOO;

Yep, if that trigger should fail for any reason I'll never know about it.

*Shakes head*

Leave a comment