]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/debugger/debugger.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / basis / ui / debugger / debugger.factor
1 ! Copyright (C) 2006, 2011 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors continuations debugger io io.streams.string
4 kernel namespaces prettyprint ui ui.gadgets.worlds ;
5 IN: ui.debugger
6
7 : error-alert ( error -- )
8     [ "Error" ] dip [ print-error ] with-string-writer
9     system-alert ;
10
11 ! ( error -- )
12 [ error-alert ] ui-error-hook set-global
13
14 ! ( error -- )
15 [
16     ui-running? [ dup error-alert ] [ dup print-error ] if die
17 ] callback-error-hook set-global
18
19 M: world-error error.
20     "An error occurred while drawing the world " write
21     dup world>> pprint-short "." print
22     "This world has been deactivated to prevent cascading errors." print
23     error>> error. ;