Can somebody please explain me why its working in this way?
if you catch an exception, there is no error raised anymore. If you want the error to still happen, but a RAISE FORM_TRIGGER_FAILURE; behind your debug-statement.
And you should not use a WHEN-OTHERS-exception-handler, as you cannot see the reason for the exception anymore when you do so.
You have caught everything, with a when-others.
others is a catch up all exception.
If you want the exception to propagate to the calling procedure, you just have to add RAISE after your call to ovpcs.pr_debug('when validate item failed'); and the catched form_failure exception reraises to the caller.
Anyway, as they've told you , when-others is nearly always bad practice. I kill a kitten 99% of times I stumble upon this clause in code