diff --git a/basis/tools/deploy/shaker/strip-debugger.factor b/basis/tools/deploy/shaker/strip-debugger.factor index 121891b563..ec4039a9e7 100644 --- a/basis/tools/deploy/shaker/strip-debugger.factor +++ b/basis/tools/deploy/shaker/strip-debugger.factor @@ -1,14 +1,6 @@ -USING: compiler.units continuations kernel namespaces -threads.private words vocabs tools.deploy.shaker ; +USING: namespaces tools.deploy.shaker ; IN: debugger : error. ( error -- ) original-error get die-with2 ; : print-error ( error -- ) error. ; - -"threads" vocab [ - [ - "error-in-thread" "threads" lookup - [ [ drop error. ] define ] [ f "combination" set-word-prop ] bi - ] with-compilation-unit -] when diff --git a/basis/tools/deploy/shaker/strip-ui-error-hook.factor b/basis/tools/deploy/shaker/strip-ui-error-hook.factor index 0664dc5e8e..378bc7e27a 100644 --- a/basis/tools/deploy/shaker/strip-ui-error-hook.factor +++ b/basis/tools/deploy/shaker/strip-ui-error-hook.factor @@ -1,7 +1,11 @@ -USING: namespaces tools.deploy.config fry sequences system kernel ui ui.gadgets.worlds ; +USING: continuations namespaces sequences kernel ui +ui.gadgets.worlds ; -deploy-name get "Factor" or '[ - _ " encountered an error." append +[ + "Error" "The application encountered an error it cannot recover from and will now exit." system-alert die -] ui-error-hook set-global +] +[ ui-error-hook set-global ] +[ callback-error-hook set-global ] +[ [ drop ] prepose thread-error-hook set-global ] tri diff --git a/basis/ui/debugger/debugger.factor b/basis/ui/debugger/debugger.factor index e2c8b06bdd..e0abfe05be 100644 --- a/basis/ui/debugger/debugger.factor +++ b/basis/ui/debugger/debugger.factor @@ -1,16 +1,20 @@ -! Copyright (C) 2006, 2009 Slava Pestov. +! Copyright (C) 2006, 2011 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors debugger io kernel namespaces prettyprint -ui.gadgets.panes ui.gadgets.worlds ui ; +USING: accessors continuations debugger io io.streams.string +kernel namespaces prettyprint ui ui.gadgets.worlds ; IN: ui.debugger -: ( error -- pane ) - [ [ print-error ] with-pane ] keep ; inline +: error-alert ( error -- ) + [ "Error" ] dip [ print-error ] with-string-writer + system-alert ; -: error-window ( error -- ) - "Error" open-window ; +! ( error -- ) +[ error-alert ] ui-error-hook set-global -[ error-window ] ui-error-hook set-global +! ( error -- ) +[ + ui-running? [ dup error-alert ] [ dup print-error ] if die +] callback-error-hook set-global M: world-error error. "An error occurred while drawing the world " write diff --git a/basis/ui/tools/debugger/debugger.factor b/basis/ui/tools/debugger/debugger.factor index a4fda6600e..af987d7dd0 100644 --- a/basis/ui/tools/debugger/debugger.factor +++ b/basis/ui/tools/debugger/debugger.factor @@ -1,13 +1,14 @@ -! Copyright (C) 2006, 2009 Slava Pestov. +! Copyright (C) 2006, 2011 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays hashtables io kernel math models -colors.constants namespaces sequences words continuations debugger -prettyprint help editors fonts ui ui.commands ui.gestures ui.gadgets -ui.pens.solid ui.gadgets.worlds ui.gadgets.packs ui.gadgets.buttons -ui.gadgets.labels ui.gadgets.presentations ui.gadgets.viewports -ui.gadgets.tables ui.gadgets.tracks ui.gadgets.scrollers -ui.gadgets.borders ui.gadgets.status-bar ui.tools.traceback -ui.tools.inspector ui.tools.browser ui.debugger ; +colors.constants namespaces sequences words continuations +debugger prettyprint help editors fonts ui ui.commands +ui.debugger ui.gestures ui.gadgets ui.pens.solid +ui.gadgets.worlds ui.gadgets.packs ui.gadgets.buttons +ui.gadgets.labels ui.gadgets.presentations ui.gadgets.panes +ui.gadgets.viewports ui.gadgets.tables ui.gadgets.tracks +ui.gadgets.scrollers ui.gadgets.borders ui.gadgets.status-bar +ui.tools.traceback ui.tools.inspector ui.tools.browser ; IN: ui.tools.debugger TUPLE: debugger < track error restarts restart-hook restart-list continuation ; @@ -26,6 +27,9 @@ M: restart-renderer row-columns t >>selection-required? t >>single-click? ; inline +: ( error -- pane ) + [ [ print-error ] with-pane ] keep ; inline + : ( debugger -- gadget ) [ ] dip [ error>> add-gadget ] @@ -66,7 +70,7 @@ M: object error-in-debugger? drop f ; [ dup error-in-debugger? - [ rethrow ] [ error-continuation get debugger-window ] if + [ error-alert ] [ error-continuation get debugger-window ] if ] ui-error-hook set-global debugger "gestures" f {