Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

using RAISE EXCEPTION TYPE and not get the runtime error UNCAUGHT_EXCEPTION

Former Member
0 Kudos

I'm trying to use RAISE EXCEPTION TYPE within a method.

But when I test the path I get an UNCAUGHT_EXCEPTION exception run time error.

I've googled for solutions and I can't find any answers. I've seen other code usage doing the same thing in other programs so it works. I am missing something...

Thank you in advance for help.

Glenn Allen

<personal information removed by moderator>

3 REPLIES 3

matt
Active Contributor

From the dump, it looks like you've thrown the error from your method, but nothing further up the call hierarchy has caught it. The calling method must either handle the exception, or throw it up to a higher level.

e.g

TRY.

object->get_current_per_yr( .... ).

CATCH zcx_zz_msg into DATA(error).  " Error handling

ENDTRY.

naimesh_patel
Active Contributor
0 Kudos

You need to have the TRY.. CATCH .. ENTRY block to catch this exception where the method is being called. If you are not calling this method directly but, this method is called from another method, then all the methods of the call stack needs to have the exception declared in the method signature.

Refer:

Regards.