Go to the first, previous, next, last section, table of contents.
-
A raise_statement raises an exception.
Syntax
-
raise_statement ::= raise [exception_name];
Legality Rules
-
The name, if any, in a raise_statement shall denote an exception. A
raise_statement with no exception_name (that is, a re-raise statement)
shall be within a handler, but not within a body enclosed by that
handler.
Dynamic Semantics
-
To raise an exception is to raise a new occurrence of that exception, as
explained in See section 11.4 Exception Handling. For the execution of a raise_statement with an
exception_name, the named exception is raised. For the execution of a
re-raise statement, the exception occurrence that caused transfer of
control to the innermost enclosing handler is raised again.
Examples
-
Examples of raise statements:
-
raise Ada.IO_Exceptions.Name_Error; -- See section A.13 Exceptions in Input-Output
-
raise;
-- re-raise the current exception
Go to the first, previous, next, last section, table of contents.