summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee.scm21
1 files changed, 10 insertions, 11 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 512aa4a..e2a705f 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -83,17 +83,16 @@
(newline port)))
(define (call-with-error-handling thunk)
- (let ((stack #f))
- (catch #t
- thunk
- (lambda (key . args)
- (if (hook-empty? error-hook)
- (apply throw key args)
- (begin
- (display-game-loop-error stack key args)
- (run-hook error-hook stack key args))))
- (lambda (key . args)
- (set! stack (make-stack #t 3))))))
+ (if (hook-empty? error-hook)
+ (thunk)
+ (let ((stack #f))
+ (catch #t
+ thunk
+ (lambda (key . args)
+ (display-game-loop-error stack key args)
+ (run-hook error-hook stack key args))
+ (lambda (key . args)
+ (set! stack (make-stack #t 3)))))))
(define-syntax-rule (run-hook* args ...)
(call-with-error-handling