11.3 Raise Statements and Raise Expressions
raise_statement ::= raise
| raise exception_name
Name Resolution Rules
To raise an exception
is to raise a new occurrence of that exception, as explained in 11.4
For the execution of a raise_statement
with an exception_name
the named exception is raised. Similarly, for the evaluation of a raise_expression
the named exception is raised. In both of these cases, if a string_expression
is present, the expression is evaluated and its value is associated with
the exception occurrence.
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 of raise
Ada.IO_Exceptions.Name_Error; -- see A.13
"Buffer Full"; -- see 9.11
raise; -- re-raise the current exception
-- For an example of a raise expression, see the Streams Subsystem definitions in 13.13.1.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe