G-5070: Avoid using Oracle predefined exceptions.

Critical

Reliability

Reason

You have raised an exception whose name was defined by Oracle. While it is possible that you have a good reason for "using" one of Oracle's predefined exceptions, you should make sure that you would not be better off declaring your own exception and raising that instead.

If you decide to change the exception you are using, you should apply the same consideration to your own exceptions. Specifically, do not "re-use" exceptions. You should define a separate exception for each error condition, rather than use the same exception for different circumstances.

Being as specific as possible with the errors raised will allow developers to check for, and handle, the different kinds of errors the code might produce.

BEGIN
RAISE NO_DATA_FOUND;
END;
/


Example (good)

DECLARE
my_exception EXCEPTION;
BEGIN
RAISE my_exception;
END;
/