From 2ee70a5ea5506676c9d2594d13aa7cc6afb47305 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 28 Dec 2014 00:13:50 -0500 Subject: [PATCH] Terminate after 3 exceptions, for ease of debugging during initial development --- rmacs/editor.rkt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rmacs/editor.rkt b/rmacs/editor.rkt index b2baa74..8a45f54 100644 --- a/rmacs/editor.rkt +++ b/rmacs/editor.rkt @@ -166,10 +166,13 @@ (define (root-keyseq-handler editor) (modeset-keyseq-handler (editor-active-modeset editor))) +(define *error-count* 0) (define (open-debugger editor exc) (local-require (only-in web-server/private/util exn->string)) (define error-report (exn->string exc)) (log-error "Exception:\n~a\n" error-report) + (set! *error-count* (+ *error-count* 1)) + (when (>= *error-count* 3) (exit)) (define b (find-buffer editor "*Error*")) (buffer-replace-contents! b (string->rope error-report)) (open-window editor b))