1-- Copyright 1994 Grady Booch 2-- Copyright 1998-2014 Simon Wright <simon@pushface.org> 3 4-- This package is free software; you can redistribute it and/or 5-- modify it under terms of the GNU General Public License as 6-- published by the Free Software Foundation; either version 2, or 7-- (at your option) any later version. This package is distributed in 8-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without 9-- even the implied warranty of MERCHANTABILITY or FITNESS FOR A 10-- PARTICULAR PURPOSE. See the GNU General Public License for more 11-- details. You should have received a copy of the GNU General Public 12-- License distributed with this package; see file COPYING. If not, 13-- write to the Free Software Foundation, 59 Temple Place - Suite 14-- 330, Boston, MA 02111-1307, USA. 15 16-- As a special exception, if other files instantiate generics from 17-- this unit, or you link this unit with other files to produce an 18-- executable, this unit does not by itself cause the resulting 19-- executable to be covered by the GNU General Public License. This 20-- exception does not however invalidate any other reasons why the 21-- executable file might be covered by the GNU Public License. 22 23package body BC.Support.Exceptions is 24 25 26 procedure Report 27 (The_Exception : Ada.Exceptions.Exception_Occurrence; 28 To : Ada.Text_IO.File_Type := Ada.Text_IO.Standard_Output) is 29 use Ada.Text_IO; 30 begin 31 if Ada.Exceptions.Exception_Message (The_Exception)'Length = 0 then 32 Put_Line (File => To, 33 Item => "Exception " 34 & Ada.Exceptions.Exception_Name (The_Exception) 35 & " occurred."); 36 else 37 Put_Line (File => To, 38 Item => "Exception " 39 & Ada.Exceptions.Exception_Name (The_Exception) 40 & " (" 41 & Ada.Exceptions.Exception_Message (The_Exception) 42 & ") occurred."); 43 end if; 44 end Report; 45 46 47end BC.Support.Exceptions; 48