Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: help with exceptions please
jgarfield_at_earthlink.net wrote:
> On Sep 23, 6:54 pm, DA Morgan <damor..._at_psoug.org> wrote:
>> jgarfi..._at_earthlink.net wrote: >>> RAISE_APPLICATION_ERROR(error_number, error_message [, keep_errors]) >>> since they have no name, there is no way one could catch them using: >>> EXEPTION >>> WHEN error_name THEN >>> so there's nothing you can do about them. >> The intent of RAISE_APPLICATION_ERROR is not to trap them it is to >> RAISE them as in send them to the front-end application. This syntax >> is most commonly found in an exception block.
That's how I would use it. Trap the exception, log it in the exception block, and then raise an application specific exception, to communicate with the end user.
>>> (by the way, why would one want to keep_errors or not keep_errors >>> here?)
Throw it away and you may lose the originating cause. End users, however, do not take kindly to cryptic error stacks. So you process the stack, store it in a log file for future research, and then raise a user friendly exception for the application.
> But now I do have a question. If the point of the negative number
> type errors is not to trap them, then what would be the point of
> associating them with an identifier/name using EXCEPTION_INIT?
The point of the number is to make analysis simple whether it is a question of looking it up in a manual or analyzing the exceptions generated by an application in order to fix the most common ones.
> also, as for the terminology are the ones with negative numbers called
> exceptions too? Or application errors? Just trying to understand> here.
All exceptions have negative numbers.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Sep 25 2007 - 10:31:36 CDT