]> gitweb.factorcode.org Git - factor.git/blobdiff - core/continuations/continuations.factor
Create basis vocab root
[factor.git] / core / continuations / continuations.factor
index f2cc0f74bacc22c79ca4caf59a55d2c725ae25b5..11162be4d36042880b736584c14af2c78e70a7a2 100755 (executable)
@@ -184,3 +184,20 @@ M: condition compute-restarts
         [ condition-continuation [ <restart> ] curry ] bi
         { } assoc>map
     ] bi append ;
+
+<PRIVATE
+
+: init-error-handler ( -- )
+    V{ } clone set-catchstack
+    ! VM calls on error
+    [
+        ! 63 = self
+        63 getenv error-thread set-global
+        continuation error-continuation set-global
+        rethrow
+    ] 5 setenv
+    ! VM adds this to kernel errors, so that user-space
+    ! can identify them
+    "kernel-error" 6 setenv ;
+
+PRIVATE>