From 0cade47534c9a7167b21a4fd6241f0b7e2dde0ae Mon Sep 17 00:00:00 2001 From: eknauel Date: Sat, 20 Aug 2005 08:14:36 +0000 Subject: [PATCH] install an error handler for the execution of commands. --- scheme/nuit-engine.scm | 45 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/scheme/nuit-engine.scm b/scheme/nuit-engine.scm index 86eef89..5ea0110 100644 --- a/scheme/nuit-engine.scm +++ b/scheme/nuit-engine.scm @@ -175,27 +175,30 @@ standard-command-plugin)) (define (eval-command-in-command-mode command-line) - (let* ((tokens (split-command-line command-line)) - (command (car tokens)) - (args (cdr tokens)) - (command-plugin (find-command-plugin command)) - (viewer - (find/init-plugin-for-result - (with-errno-handler - ((errno data) - (else data)) - ((command-plugin-evaluater command-plugin) command args)))) - (new-entry - (make-history-entry command args viewer))) - ;; FIXME, use insert here - (append-to-history! new-entry) - (signal-result-buffer-object-change) - (obtain-lock paint-lock) - (paint-result-window new-entry) - (refresh-result-window) - (move-cursor (command-buffer) (result-buffer)) - (refresh-command-window) - (release-lock paint-lock))) + (with-fatal-error-handler* + display-error-and-continue + (lambda () + (let* ((tokens (split-command-line command-line)) + (command (car tokens)) + (args (cdr tokens)) + (command-plugin (find-command-plugin command)) + (viewer + (find/init-plugin-for-result + (with-errno-handler + ((errno data) + (else data)) + ((command-plugin-evaluater command-plugin) command args)))) + (new-entry + (make-history-entry command args viewer))) + ;; FIXME, use insert here + (append-to-history! new-entry) + (signal-result-buffer-object-change) + (obtain-lock paint-lock) + (paint-result-window new-entry) + (refresh-result-window) + (move-cursor (command-buffer) (result-buffer)) + (refresh-command-window) + (release-lock paint-lock))))) (define (display-error-and-continue condition more) (let ((win (app-window-curses-win (result-window))))