If rendering an error popup fails, don't open an endless stream
parent
8f0b335f4b
commit
bcd2ffc830
|
@ -30,7 +30,7 @@ ERROR: no-world-found ;
|
|||
|
||||
: (request-focus) ( child world ? -- )
|
||||
pick parent>> pick eq? [
|
||||
>r >r dup parent>> dup r> r>
|
||||
[ dup parent>> dup ] 2dip
|
||||
[ (request-focus) ] keep
|
||||
] unless focus-child ;
|
||||
|
||||
|
@ -80,7 +80,7 @@ SYMBOL: ui-error-hook
|
|||
: ui-error ( error -- )
|
||||
ui-error-hook get [ call ] [ print-error ] if* ;
|
||||
|
||||
[ rethrow ] ui-error-hook set-global
|
||||
ui-error-hook global [ [ rethrow ] or ] change-at
|
||||
|
||||
: draw-world ( world -- )
|
||||
dup draw-world? [
|
||||
|
|
|
@ -35,7 +35,15 @@ M: debugger focusable-child* restarts>> ;
|
|||
#! No restarts for the debugger window
|
||||
f [ drop ] <debugger> "Error" open-window ;
|
||||
|
||||
[ debugger-window ] ui-error-hook set-global
|
||||
GENERIC: error-in-debugger? ( error -- ? )
|
||||
|
||||
M: world-error error-in-debugger? world>> gadget-child debugger? ;
|
||||
|
||||
M: object error-in-debugger? drop f ;
|
||||
|
||||
[
|
||||
dup error-in-debugger? [ rethrow ] [ debugger-window ] if
|
||||
] ui-error-hook set-global
|
||||
|
||||
M: world-error error.
|
||||
"An error occurred while drawing the world " write
|
||||
|
|
Loading…
Reference in New Issue