]> gitweb.factorcode.org Git - factor.git/commitdiff
Hopefully fix stack effects of error hooks to throw when required.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 29 Mar 2016 05:27:35 +0000 (22:27 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 29 Mar 2016 05:27:35 +0000 (22:27 -0700)
basis/debugger/threads/threads.factor
basis/io/thread/thread.factor
basis/tools/deploy/shaker/strip-ui-error-hook.factor
basis/ui/debugger/debugger.factor
basis/ui/gadgets/worlds/worlds.factor
core/continuations/continuations.factor

index 3f5a074b25325f10181af9f2e49fe38b122373e9..c3fd8284dba768112e5d459ee3eba779b1bc4e62 100644 (file)
@@ -12,9 +12,11 @@ IN: debugger.threads
         ", " % dup quot>> unparse-short % ")" %
     ] "" make swap write-object ":" print ;
 
-! ( error thread -- )
+! ( error thread -- )
 [
-    dup initial-thread get-global eq? [ die ] [
+    dup initial-thread get-global eq? [
+        die drop throw
+    ] [
         [
             error-in-thread. nl
             print-error nl
index 461e383f2945dc5ab9a2020d6c89db60de630394..9efd22ad8b68fec1c57daa9a9af1835932b97060 100644 (file)
@@ -18,7 +18,7 @@ TUPLE: io-thread < thread ;
     "I/O wait"
     io-thread new-thread ;
 
-M: io-thread error-in-thread [ die ] call( error thread -- * ) ;
+M: io-thread error-in-thread die drop throw ;
 
 : start-io-thread ( -- )
     t io-thread-running? set-global
index 378bc7e27ada75fec2230ab84947ef9aa437f4aa..664a658ee05f7d4f9fb85b534d478fcf464589f9 100644 (file)
@@ -4,7 +4,7 @@ ui.gadgets.worlds ;
 [
     "Error"
     "The application encountered an error it cannot recover from and will now exit."
-    system-alert die
+    system-alert die 1 exit
 ]
 [ ui-error-hook set-global ]
 [ callback-error-hook set-global ]
index ec4534a3dc3bafe7f91a3c1784888adbecfbf0eb..d260f184bebacbaca8bfddb9b0926e3ee4fffcec 100644 (file)
@@ -11,9 +11,9 @@ IN: ui.debugger
 ! ( error -- )
 [ error-alert ] ui-error-hook set-global
 
-! ( error -- )
+! ( error -- )
 [
-    ui-running? [ dup error-alert ] [ dup print-error ] if die
+    ui-running? [ dup error-alert ] [ dup print-error ] if die throw
 ] callback-error-hook set-global
 
 M: world-error error.
index a374d9fa8f9d5f0989c9c4ce4a574ef33317694b..5004ede420de052ef415d6b674b34fc4a89a849a 100644 (file)
@@ -203,7 +203,7 @@ TUPLE: world-error error world ;
 
 C: <world-error> world-error
 
-SYMBOL: ui-error-hook
+SYMBOL: ui-error-hook ! ( error -- )
 
 : ui-error ( error -- )
     ui-error-hook get [ call( error -- ) ] [ die drop ] if* ;
index 220cef3e8ddb303109b3b6bbed77964847c929ab..dbe645b82886699e5ef52694ef42b1fc0fbad2a2 100644 (file)
@@ -117,18 +117,18 @@ PRIVATE>
 
 GENERIC: error-in-thread ( error thread -- * )
 
-SYMBOL: thread-error-hook ! ( error thread -- )
+SYMBOL: thread-error-hook ! ( error thread -- )
 
-thread-error-hook [ [ die ] ] initialize
+thread-error-hook [ [ die drop throw ] ] initialize
 
-M: object error-in-thread ( error thread -- * )
+M: object error-in-thread
     thread-error-hook get-global call( error thread -- * ) ;
 
 : in-callback? ( -- ? ) CONTEXT-OBJ-IN-CALLBACK-P context-object ;
 
 SYMBOL: callback-error-hook ! ( error -- * )
 
-callback-error-hook [ [ die ] ] initialize
+callback-error-hook [ [ die throw ] ] initialize
 
 : rethrow ( error -- * )
     dup save-error