summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2022-11-08 20:56:19 -0500
committerDavid Thompson <dthompson@vistahigherlearning.com>2022-11-08 20:56:19 -0500
commit75ec9f00916227054ca092c6e38cff1fda22173f (patch)
tree444b9979fab28c4856308faa6bb42e229a98c93c
parent4950f0e791f9cab3092718c36200d01cef06bf89 (diff)
kernel: Improve error handling.
-rw-r--r--catbird/kernel.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/catbird/kernel.scm b/catbird/kernel.scm
index 08d26ba..413e1b4 100644
--- a/catbird/kernel.scm
+++ b/catbird/kernel.scm
@@ -304,12 +304,21 @@
(set! (stack kernel) s)
(set! (exception kernel) e)
(set! (debugging? kernel) #t)
+ (let ((port (current-error-port)))
+ (display "an error has occurred!\n\n" port)
+ (display "Backtrace:\n" port)
+ (display-backtrace s port)
+ (newline port)
+ (display (error-message kernel) port)
+ (newline port))
(display "waiting for developer to debug..." (current-error-port))
(while (debugging? kernel)
(poll-coop-repl-server (repl kernel))
(usleep 160000)
#t)
- (set-window-title! window title))
+ (set-window-title! window title)
+ (set! (stack kernel) #f)
+ (set! (exception kernel) #f))
(raise-exception e)))
(define-method (error-message (kernel <kernel>))