2016-04-02 12:30:41 -04:00
|
|
|
! Copyright (C) 2006, 2011 Slava Pestov.
|
2015-06-29 19:43:15 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: accessors continuations debugger io io.streams.string
|
|
|
|
kernel namespaces prettyprint ui ui.gadgets.worlds ;
|
|
|
|
IN: ui.debugger
|
|
|
|
|
|
|
|
: error-alert ( error -- )
|
|
|
|
[ "Error" ] dip [ print-error ] with-string-writer
|
|
|
|
system-alert ;
|
|
|
|
|
|
|
|
! ( error -- )
|
|
|
|
[ error-alert ] ui-error-hook set-global
|
|
|
|
|
2016-03-29 01:27:35 -04:00
|
|
|
! ( error -- * )
|
2015-06-29 19:43:15 -04:00
|
|
|
[
|
2016-04-06 20:30:22 -04:00
|
|
|
ui-running? [ dup error-alert ] [ dup print-error ] if die rethrow
|
2015-06-29 19:43:15 -04:00
|
|
|
] callback-error-hook set-global
|
|
|
|
|
|
|
|
M: world-error error.
|
|
|
|
"An error occurred while drawing the world " write
|
|
|
|
dup world>> pprint-short "." print
|
|
|
|
"This world has been deactivated to prevent cascading errors." print
|
|
|
|
error>> error. ;
|