Exception Classes

Superclasses for exception classes

Exception classes are subclasses of the global classes

The general superclass of these classes is CX_ROOT. Assignment to one of these three superclasses determines whether an exception must be declared directly in the interface of the procedure when propagating from a procedure, and how it is declared:

Notes

Definition of exception classes

Exception classes can be defined globally in the Class Builder, or locally in a program. The names of global exception classes have the prefix CX_, or YCX_, ZCX_ etc. for exception classes created in customer systems. There is a set of predefined global exception classes, for example, those with the prefix CX_SY_,, which contain exceptions that are triggered by exception situations in the runtime environment.

All exception classes inherit the following instance methods from CX_ROOT:

All exception classes inherit the following instance attributes from CX_ROOT:

The Class Builder generates an instance constructor that cannot be changed for global exception classes, which has optional input parameters for all non-private attributes and sets these to the value of these input parameters. The ID of the required exception text can be passed on to TEXTID. For local exception classes, there are no specific rules for the instance constructor.

Notes

Exception Texts

A text that can be assigned parameters by attributes is assigned to each exception, and described the exception situation. If the exception is not treated, this text is displayed in the short dump of the runtime error. When the exception is treated in the program, the text can be retrieved using the method GET_TEXT. One or more texts can be defined for an exception in the Class Builder. There are two options for defining texts:

For each exception text, the Class Builder creates a static constant in the exception class, which has the name as the exception text. When the exception is triggered, this name can be transferred to the parameter TEXTID of the constructor to determine the exception text. If the parameter is not transferred, a predefined exception text with the same name as the exception class is used.

Notes