1. -- 
  2. -- Uwe R. Zimmer, Australia, 2014 
  3. -- 
  4.  
  5. with Ada.Characters.Latin_1;  use Ada.Characters.Latin_1; 
  6. with Ada.Task_Identification; use Ada.Task_Identification; 
  7. with Ada.Text_IO;             use Ada.Text_IO; 
  8. --  with GNAT.Traceback.Symbolic; use GNAT.Traceback.Symbolic; 
  9.  
  10. package body Exceptions is 
  11.  
  12.    -------------------- 
  13.    -- Show_Exception -- 
  14.    -------------------- 
  15.  
  16.    procedure Show_Exception (Exception_Identifier : Exception_Occurrence; 
  17.                              Optional_Message     : String := "") is 
  18.  
  19.    begin 
  20.       Put_Line (Current_Error, "Task " & Image (Current_Task) & " reports: "); 
  21.       Put_Line (Current_Error, Exception_Information (Exception_Identifier)); 
  22.       if Optional_Message /= "" then 
  23.          Put_Line ("Additional message: " & Optional_Message); 
  24.       end if; 
  25. --        Put_Line (Symbolic_Traceback (Exception_Identifier)); 
  26.    end Show_Exception; 
  27.  
  28.    -------------------- 
  29.    -- Wrap_Exception -- 
  30.    -------------------- 
  31.  
  32.    function Wrap_Exception (Original_Exception : Exception_Occurrence; 
  33.                             Optional_Message   : String := "") return String is 
  34.  
  35.      ("[ " & Exception_Information (Original_Exception) & ']' & 
  36.       (if Optional_Message /= "" 
  37.        then LF & "with: " & Optional_Message 
  38.        else "")); 
  39.  
  40. end Exceptions;