11.3. Raise Statements

[PREVIOUS][UP][NEXT]

A raise statement raises an exception.

    raise_statement ::= raise [exception_name]; 

For the execution of a raise statement with an exception name, the named exception is raised. A raise statement without an exception name is only allowed within an exception handler (but not within the sequence of statements of a subprogram, package, task unit, or generic unit, enclosed by the handler); it raises again the exception that caused transfer to the innermost enclosing handler.

Examples:

    raise SINGULAR;
    raise NUMERIC_ERROR;  --  explicitly raising a predefined exception 

    raise;                --  only within an exception handler 

References: exception, generic unit, name, package, sequence of statements, subprogram, task unit.


[INDEX][CONTENTS]