Ada Programming/Libraries/Ada.Exceptions

From Wikibooks, open books for an open world
Jump to navigation Jump to search


The package Ada.Exceptions allows you to analyze exceptions you have caught, to raise exceptions with an associated message or to save exceptions occurrences for later processing.


The following example shows how to implement a "last resort" error handler which just displays the information related to the error which occurred.

File: numeric_6.adb (view, plain text, download page, browse all)
 with Ada.Exceptions;

 procedure Numeric_6  is
   package Exept  renames Ada.Exceptions;
               when An_Exception :  others =>
                   (Exept.Exception_Information (An_Exception));
            end Try;

See also[edit]


External examples[edit]

Ada Reference Manual[edit]

Ada 95[edit]

Ada 2005[edit]