summary refs log tree commit diff stats
path: root/tests/cpp/tcppraise.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-08-17 10:37:38 +0200
committerGitHub <noreply@github.com>2019-08-17 10:37:38 +0200
commitdb9e27dffd266c0a69ac3d3544fb9aa563676096 (patch)
tree8af8a0048d624b3fbfe8688226fdfbc57db669eb /tests/cpp/tcppraise.nim
parentcf09ef47b85363554a3475413481b4f513ef77ae (diff)
parent721ca3e83087c6c4a7299102d04ba912d4f8dbae (diff)
downloadNim-db9e27dffd266c0a69ac3d3544fb9aa563676096.tar.gz
Fixes #11118 (#11964)
* fixes #11118

* Reset closure iter exception before rethrowing
Diffstat (limited to 'tests/cpp/tcppraise.nim')
-rw-r--r--tests/cpp/tcppraise.nim24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/cpp/tcppraise.nim b/tests/cpp/tcppraise.nim
index 84cacf7f0..8f34cb3e4 100644
--- a/tests/cpp/tcppraise.nim
+++ b/tests/cpp/tcppraise.nim
@@ -5,6 +5,9 @@ bar
 Need odd and >= 3 digits##
 baz
 caught
+--------
+Triggered raises2
+Raising ValueError
 '''
 """
 
@@ -45,3 +48,24 @@ try:
 finally:
   for foobar in strs:
     discard
+
+
+# issue #11118
+echo "--------"
+proc raises() =
+  raise newException(ValueError, "Raising ValueError")
+
+proc raises2() =
+  try:
+    raises()
+  except ValueError as e:
+    echo "Triggered raises2"
+    raise e
+
+try:
+  raises2()
+except:
+  echo getCurrentExceptionMsg()
+  discard
+
+doAssert: getCurrentException() == nil
\ No newline at end of file