TAW_12 Chapter 8, Class based exceptions Flashcards
What is an exception?
A situation that arises when a program is executing from which there is no way or reason to continue
All exception classes are derived from CX_ROOT?
Yes, but it can not be directly used for a super class of an exception class
What is the default class for a exception class
CX_STATIC_CHECK
What three subclasses of CX_ROOT can be used as super classes for exception classes
CX_STATIC-CHECK
CX_NO_CHECK
CX_DYNAMIC_CHECK
When is the CLEANUP block executed?
Just before leaving the try block, this is used when the catch is handled in an outer try block
If an exception is raised during debugging, how can it be viewed
The EXCEPTION RAISED field is filled
In debugger the buttons Last Exception Object and Display Trigger Location can be used. This must be configed in settings. Otherwise the last exception buton does not appear if the INTO is missing from the catch statement
What default textid should always exist?
A default text with the name of the exception class itself.
What are the two variants of the raise exception?
RAISE EXCEPTION TYPE RAISE EXCEPTION (this is only useful for propagating the exception forward. For example CATCH ZCX_ERROR into LCX_ERROR. RAISE EXCEPTION LCX_ERROR)
If TEXTID is not supplied when RAISE EXCEPTION TYPE, what happens
It will use the default which has the exception class name
Can the RAISING addition be used with FORMS as well as methods?
Yes and in function modules as well
When an exception is raised, processing continues from where
From the point of the catch. Even if the catch is levels above where the exception occurred. However, if a cleanup block exists in a try block before the handling, it happens first
Name the two main sub classes of CX_DYNAMIC_CHECK
CX_SY_ARITHMETIC_CHECK and CX_SY_MOVE_CAST_ERROR
Can CX_NO_CHECK exceptions be RAISED
No, they are system issued only
What is the difference between RETRY and RESUME
Retry starts at the top of the try block, resume starts at where the exception was raised
How can a exception be resumed
The exception must be caught with the BEFORE UNWIND
The exception must be raised with RAISE RESUMABLE The exception must be propagated with RESUMABLE(CX_CLASS)