Ada Programming/Libraries/Ada.Exceptions


Ada Lovelace 1838.jpg

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.

UsageEdit

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;
...
           exception
              when An_Exception : others =>
                 T_IO.Put_Line
                   (Exept.Exception_Information (An_Exception));
           end Try;

See alsoEdit

WikibookEdit

Ada Reference ManualEdit

Ada 95Edit

Ada 2005Edit

Last modified on 22 March 2013, at 16:39