with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Task_Identification; use Ada.Task_Identification;
with Ada.Text_IO; use Ada.Text_IO;
package body Exceptions is
procedure Show_Exception (Exception_Identifier : Exception_Occurrence;
Optional_Message : String := "") is
begin
Put_Line (Current_Error, "Task " & Image (Current_Task) & " reports: ");
Put_Line (Current_Error, Exception_Information (Exception_Identifier));
if Optional_Message /= "" then
Put_Line ("Additional message: " & Optional_Message);
end if;
end Show_Exception;
function Wrap_Exception (Original_Exception : Exception_Occurrence;
Optional_Message : String := "") return String is
("[ " & Exception_Information (Original_Exception) & ']' &
(if Optional_Message /= ""
then LF & "with: " & Optional_Message
else ""));
end Exceptions;