summary refs log tree commit diff stats
path: root/compiler/vmops.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/vmops.nim')
-rw-r--r--compiler/vmops.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/vmops.nim b/compiler/vmops.nim
index aa25d208a..ef2bfabb2 100644
--- a/compiler/vmops.nim
+++ b/compiler/vmops.nim
@@ -44,6 +44,10 @@ template wrap2svoid(op) {.immediate, dirty.} =
     op(getString(a, 0), getString(a, 1))
   systemop op
 
+proc getCurrentExceptionMsgWrapper(a: VmArgs) {.nimcall.} =
+  setResult(a, if a.currentException.isNil: ""
+               else: a.currentException.sons[2].strVal)
+
 proc registerAdditionalOps*(c: PCtx) =
   wrap1f(sqrt)
   wrap1f(ln)
@@ -73,3 +77,4 @@ proc registerAdditionalOps*(c: PCtx) =
   wrap1s(dirExists)
   wrap1s(fileExists)
   wrap2svoid(writeFile)
+  systemop getCurrentExceptionMsg