Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX_ERROR not showing custom message when called from an exception

SaraBJun 21 2022

Hi
We're running APEX 21.2.6 and have code to show a custom error message when there is an unhandled error. The message is along the lines of "An unexpected error occurred, please quote reference 123456" and is raised from a when others exception.
We have a lot of error handling, so this really is only when something unexpected has happened. This was working, but at some point it appears to have stopped. As these errors don't occur very often (they shouldn't happen at all) it's difficult to know when this stopped working as it's only been found as I deliberately broke something to test some error handling.
When we call apex_error.add_error from within a process on a page then it works fine. But when it is called from an exception handler (others, no_data_found etc.) then it displays the Oracle error message instead.
It's definitely firing the code because if you click on the (i) it says the original message e.g.
image.pngUnfortunately it is just the "no data found" message that is displayed to the user.
I've tried to reproduce this on apex.oracle.com with similar code, but it works fine:
image.pngNotice that "original message" is only on our app.
This feels like there is a setting that we need to change since upgrading, but I can't find an obvious one or think why you'd want to show the Oracle error rather than your custom message...
Does anyone have any ideas as to why the original message is being changed? And how I can fix it?
Many thanks for any suggestions!
Sara

Comments
Post Details
Added on Jun 21 2022
0 comments
674 views