18.10.2014 Views

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Exceptions 185<br />

Note:<br />

The object Event is declared as:<br />

Event : Exception_Ocurrence;<br />

and is def<strong>in</strong>ed <strong>in</strong> the package <strong>Ada</strong>.Exceptions.<br />

In the above exception handler the exception is known by the name event. Information about the exception is<br />

obta<strong>in</strong>ed by us<strong>in</strong>g the follow<strong>in</strong>g functions:<br />

Function<br />

(Def<strong>in</strong>ed <strong>in</strong> <strong>Ada</strong>.Exceptions)<br />

Exception_Name(event)<br />

Exception_Information(event)<br />

Exception_Message(event)<br />

Returns as a str<strong>in</strong>g:<br />

In upper case the exception name start<strong>in</strong>g<br />

with the root library unit.<br />

Detailed <strong>in</strong>formation about the exception.<br />

A short explanation of the exception.<br />

Other functions and procedures <strong>in</strong> <strong>Ada</strong>.Exceptions are:<br />

Function / procedure<br />

Reraise_Occurrence(event)<br />

Raise_Exception(e,"Mess")<br />

Action<br />

A procedure which re-raises the exception<br />

event.<br />

A procedure which raises exception e with<br />

the message "Mess".<br />

© M A Smith - May not be reproduced without permission

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!