Hi,
Maybe you have to print out error_text or code first of all,
because there is a chance that it is reset when you call the
built-in function 'message'.
We usually have the following few lines in the
beginning of an ON-ERROR-TRIGGER:
DECLARE
v_error_text VARCHAR2(255) := error_text;
Thus we can be safe that the error_text has not been reset
until we need to check it (we check the v_error_text insted of
error_text then).