Re: Q: any idea what are we missing ?

On 09/20/2006 08:53:54 AM, Niall Litchfield wrote:
> It isn't being raised, which I think is the point.
> 
> I'd prefer if you expect an exception to deal with it, and otherwise reraise
> 

>  13       when others then
>  14       raise;
>  15* end tst;


There was a recent thread on Tom Kyte's blog devoted to the snippets like this 
one. OK, he 
was specifically talking about the "WHEN OTHERS" not followed by "RAISE", but 
you aren't 
doing anything here, you are catching an exception just to re-raise it in the 
next line.
What in the world makes you catch exceptions just to re-raise them? I would 
advise something 
like this:

PRAGMA EXCEPTION_INIT(CONFUSE,-600);

and then 

WHEN OTHERS THEN
     RAISE CONFUSE;
END;

That would be a great contribution to the clarity of the code and wouldn't cause
any confusion.


-- 
Mladen Gogala
http://www.mgogala.com

--
http://www.freelists.org/webpage/oracle-l


Other related posts: