summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 9153af16c..ad99306ad 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2630,6 +2630,12 @@ when not defined(JS): #and not defined(NimrodVM):
         excHandler.hasRaiseAction = true
         excHandler.raiseAction = action
 
+    proc setCurrentException*(exc: ref Exception) {.inline, gcsafe.} =
+      ## sets the current exception.
+      ##
+      ## **Warning**: Only use this if you know what you are doing.
+      currException = exc
+
   {.push stack_trace: off, profiler:off.}
   when defined(endb) and not defined(NimrodVM):
     include "system/debugger"