Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8734

Re: Catch CX_ROOT vs Specific Exception

$
0
0

As a wise man, just one post above yours said:

 

...catching cx_root is generally a no-go. Please keep in mind, that implicitly raised exceptions like CX_SY_REF_IS_INITIAL (when accessing an unbound object) are also catched and you won't receive a dump explaining what went wrong..

So unless you don't know exactly what you are doing, catch specific exceptions. If you catch CX_ROOT, you need to write additional logic, which helps you in the following aspects:

-re-raising certain exceptions, that should lead to a program exit (dump)

-output of the exact stack trace

-switching off stack trace output for end users


Viewing all articles
Browse latest Browse all 8734

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>