1 ! Copyright (C) 2006, 2011 Slava Pestov.
\r
2 ! See http://factorcode.org/license.txt for BSD license.
\r
3 USING: accessors continuations debugger io io.streams.string
\r
4 kernel namespaces prettyprint ui ui.gadgets.worlds ;
\r
7 : error-alert ( error -- )
\r
8 [ "Error" ] dip [ print-error ] with-string-writer
\r
12 [ error-alert ] ui-error-hook set-global
\r
16 ui-running? [ dup error-alert ] [ dup print-error ] if die
\r
17 ] callback-error-hook set-global
\r
19 M: world-error error.
\r
20 "An error occurred while drawing the world " write
\r
21 dup world>> pprint-short "." print
\r
22 "This world has been deactivated to prevent cascading errors." print
\r