", " % 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
"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
[
"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 ]
! ( 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.
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* ;
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