summaryrefslogtreecommitdiff
path: root/exception_test3/exceptiontest3.adb
diff options
context:
space:
mode:
Diffstat (limited to 'exception_test3/exceptiontest3.adb')
-rw-r--r--exception_test3/exceptiontest3.adb27
1 files changed, 27 insertions, 0 deletions
diff --git a/exception_test3/exceptiontest3.adb b/exception_test3/exceptiontest3.adb
new file mode 100644
index 0000000..be4bd1b
--- /dev/null
+++ b/exception_test3/exceptiontest3.adb
@@ -0,0 +1,27 @@
+--BEGIN exceptiontest3.adb
+with Ada.Text_IO; use Ada.Text_IO;
+
+procedure ExceptionTest3 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 Constraint_Error =>
+ Put_Line ("Caught Constraint_Error -- inner");
+ when others =>
+ Put_Line ("not ok wrong exception");
+ end;
+exception
+ when others =>
+ Put_Line ("Caught Constraint_Error -- outer -- not OK");
+end ExceptionTest3;
+--END exceptiontest3.adb