summary refs log tree commit diff stats
path: root/tests/accept/run/treraise.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-05-28 23:33:29 +0200
committerAndreas Rumpf <andreas@andreas-laptop>2010-05-28 23:33:29 +0200
commitb34b1dbc6c7290a893149aa9f5ea5d54a37c8522 (patch)
treed61f14d6f56eab37178242b61c83fdbbd87db30d /tests/accept/run/treraise.nim
parent6c2050912166a4960b40c3825afb1a31cfdde0eb (diff)
downloadNim-b34b1dbc6c7290a893149aa9f5ea5d54a37c8522.tar.gz
added tests
Diffstat (limited to 'tests/accept/run/treraise.nim')
-rw-r--r--tests/accept/run/treraise.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/accept/run/treraise.nim b/tests/accept/run/treraise.nim
new file mode 100644
index 000000000..60b8640c4
--- /dev/null
+++ b/tests/accept/run/treraise.nim
@@ -0,0 +1,17 @@
+type
+  ESomething = object of E_Base
+  ESomeOtherErr = object of E_Base
+
+proc genErrors(s: string) =
+  if s == "error!":
+    raise newException(ESomething, "Test")
+  else:
+    raise newException(EsomeotherErr, "bla")
+
+while True:
+  try:
+    genErrors("errssor!")
+  except ESomething:
+    echo("Error happened")
+  except:
+    raise