(handle-system-error): Pass rest argument to
[bpt/guile.git] / ice-9 / boot-9.scm
index 95c6fa6..c1f8805 100644 (file)
   (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)