summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tv2_raise.nim12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/destructor/tv2_raise.nim b/tests/destructor/tv2_raise.nim
index 75ccadd49..f8d6d30b5 100644
--- a/tests/destructor/tv2_raise.nim
+++ b/tests/destructor/tv2_raise.nim
@@ -9,10 +9,14 @@ import system / ansi_c
 import core / allocators
 
 proc mainA =
-  var e: owned(ref ValueError)
-  new(e)
-  e.msg = "message"
-  raise e
+  try:
+    var e: owned(ref ValueError)
+    new(e)
+    e.msg = "message"
+    raise e
+  except Exception as e:
+    raise
+
 
 proc main =
   raise newException(ValueError, "argh")