[CM] s7: bubbling up errors (bug?)

Christos Vagias chris.actondev at gmail.com
Sat Jul 18 11:51:28 PDT 2020

Hi all,

Stumbled upon a possible bug, unless I misunderstood something, about
bubbling up errors.
s7  version 9.3, 2020-7-18

(catch #t
(lambda ()
 (catch #t
(lambda ()
  (throw 'some-error "::: ERROR ::: (~A)~%" 1))
 (lambda args
   (format *stderr* "1st level exception args: ~A\n" args)
   (apply format *stderr* (cadr args)) ;; that works
   (apply throw args))))
(lambda args
  (format *stderr* "2nd level exc args: ~A~%" args)
  (apply format *stderr* (cadr args)) ;; that will FAIL!!!

In the second catch, the args have the "info" wrapped around an extra list.
Therefore, the (apply format *stderr* (cadr args)) fails on the 2nd level

The printout
(notice the difference between 1st and 2nd level)

1st level exception args: (some-error ("::: ERROR ::: (~A)~%" 1))
::: ERROR ::: (1)
2nd level exc args: (some-error (("::: ERROR ::: (~A)~%" 1)))

And the exception from trying to "apply format"

;format argument 2, ("::: ERROR ::: (~A)~%" 1), is a pair but should be a
;    (apply format *stderr* (cadr args))
;    *stdout*, line 13, position: 388
; ns-make-empty-let: (apply format *stderr*... ; args: (some-error ((":::
ERROR ::: (~...
; ((let? *ns*))
; ((let? *ns*))
; ((let? *ns*))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20200718/e62a8f21/attachment.html>

More information about the Cmdist mailing list