Lady Ada

Ada '83 Language Reference Manual

Copyright 1980, 1982, 1983 owned by the United States Government. Direct reproduction and usage requests to the Ada Information Clearinghouse.


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.

Rationale references: 14.2.3 The Raise Statement, 14.2.5 Raising the Same Exception Again

Style Guide references: 4.3.1 Using Exceptions to Help Define an Abstraction, 7.5.3 Implementation-Defined Exceptions, 8.2.3 Assumptions, 8.2.7 Exceptions

[INDEX][CONTENTS]


[Ada Information Clearinghouse]

Address any questions or comments to adainfo@sw-eng.falls-church.va.us.