summaryrefslogtreecommitdiff
path: root/exception_test2/exceptiontest2.adb
blob: 822ee1aa6c6504cf4de6c94174cff31d22e4a35f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--BEGIN exceptiontest2.adb
with Ada.Text_IO; use Ada.Text_IO;

procedure ExceptionTest2 is
   function F return Boolean is
   begin
      raise Constraint_Error;
      return True;
   end F;
begin
   begin
      if F then
         Put_Line ("Not ok");
      else
         Put_Line ("Not ok and bad value");
      end if;
   exception
      when others =>
         Put_Line ("Caught Constraint_Error -- inner");
   end;
exception
   when others =>
     Put_Line ("Caught Constraint_Error -- outer -- not OK");
end ExceptionTest2;
--END exceptiontest2.adb