summary refs log tree commit diff stats
path: root/tests/exception/tcontinuexc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exception/tcontinuexc.nim')
-rw-r--r--tests/exception/tcontinuexc.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/exception/tcontinuexc.nim b/tests/exception/tcontinuexc.nim
new file mode 100644
index 000000000..b7560a605
--- /dev/null
+++ b/tests/exception/tcontinuexc.nim
@@ -0,0 +1,26 @@
+discard """
+  outputsub: "ECcaught"
+  exitcode: "1"
+"""
+type
+  ESomething = object of Exception
+  ESomeOtherErr = object of Exception
+
+proc genErrors(s: string) =
+  if s == "error!":
+    raise newException(ESomething, "Test")
+  else:
+    raise newException(EsomeotherErr, "bla")
+
+try:
+  for i in 0..3:
+    try:
+      genErrors("error!")
+    except ESomething:
+      stdout.write("E")
+    stdout.write("C")
+    raise newException(EsomeotherErr, "bla")
+finally:
+  echo "caught"
+
+#OUT ECcaught