diff options
author | Andrii Riabushenko <cdome@bk.ru> | 2019-04-30 21:46:45 +0100 |
---|---|---|
committer | Andrii Riabushenko <cdome@bk.ru> | 2019-04-30 21:46:45 +0100 |
commit | 7cfc7cfb26c16c5af4710a653bddbf7e9df1cc25 (patch) | |
tree | 0ba5dd27be1fdb93adb9bc6387056dd0d11ea284 /tests/cpp | |
parent | 3d0190f470d345eafca5260bb0e350d062edffcd (diff) | |
download | Nim-7cfc7cfb26c16c5af4710a653bddbf7e9df1cc25.tar.gz |
fixes #11118
Diffstat (limited to 'tests/cpp')
-rw-r--r-- | tests/cpp/tcppraise.nim | 24 |
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 |