From c46bf6396492ec3116179900ac034919357c1b27 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 20 Jun 2026 22:49:15 +0100 Subject: scripts: Print bug report request before backtrace. This way we can delegate backtrace printing to the default exception handler. Somehow, I can't seem to get display-backtrace and make-stack to replicate the behaviour of the default exception handler. --- scripts/ccwl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/ccwl b/scripts/ccwl index fe17991..2ecd66c 100755 --- a/scripts/ccwl +++ b/scripts/ccwl @@ -100,24 +100,23 @@ exec guile --no-auto-compile -e main -s "$0" "$@" (define (main args) (with-exception-handler (lambda (condition) - ;; Catch uncaught exceptions, print their backtrace and - ;; request the user report an issue. Pass quit exceptions - ;; through since those may be raised by exceptions that have - ;; been handled. + ;; Catch uncaught exceptions, request the user report an + ;; issue, and re-raise the exception so the default exception + ;; handler can deal with it. Pass quit exceptions through + ;; since those may be raised by exceptions that have been + ;; handled. (cond ((formatted-message? condition) (report-formatted-message condition)) ((not (quit-exception? condition)) - (display-backtrace (make-stack #t) (current-error-port)) - (newline (current-error-port)) + (display "You have discovered a bug! ccwl crashed! :-( +Please report this to https://github.com/arunisaac/ccwl/issues +Thank you!\n\n" + (current-error-port)) (write condition (current-error-port)) (newline (current-error-port)) - (display " -You have discovered a bug! ccwl crashed! :-( -Please report this to https://github.com/arunisaac/ccwl/issues -Thank you! -" - (current-error-port)))) + (newline (current-error-port)) + (raise-exception condition))) (exit #f)) (lambda () (match args -- cgit 1.4.1