From 5d8d08494bcb56338c9f05e2dbbef6dda67aaab5 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 23 Sep 2004 17:56:10 +0000 Subject: [PATCH] (handle-system-error): Pass rest argument to display-backtrace for wrong-type-arg and out-of-range errors so that the bad value gets highlighted. --- ice-9/boot-9.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 95c6fa608..c1f8805b8 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2448,12 +2448,17 @@ (let ((cep (current-error-port))) (cond ((not (stack? (fluid-ref the-last-stack)))) ((memq 'backtrace (debug-options-interface)) - (run-hook before-backtrace-hook) - (newline cep) - (display "Backtrace:\n") - (display-backtrace (fluid-ref the-last-stack) cep) - (newline cep) - (run-hook after-backtrace-hook))) + (let ((highlights (if (or (eq? key 'wrong-type-arg) + (eq? key 'out-of-range)) + (list-ref args 3) + '()))) + (run-hook before-backtrace-hook) + (newline cep) + (display "Backtrace:\n") + (display-backtrace (fluid-ref the-last-stack) cep + #f #f highlights) + (newline cep) + (run-hook after-backtrace-hook)))) (run-hook before-error-hook) (apply display-error (fluid-ref the-last-stack) cep args) (run-hook after-error-hook)