exception2.scm 412 B

1234567891011121314
  1. (try-catch
  2. (try-catch
  3. (primitive-throw (java.lang.Error "my-error"))
  4. (ex1 java.lang.Throwable
  5. (let ((cf (lambda (cv)
  6. (list ex1))))
  7. (format #t "ex1:~w cf:~w~%~!" ex1 cf)
  8. (primitive-throw ex1))))
  9. (ex2 java.lang.Throwable
  10. (format #t "caught ~w~%" ex2)))
  11. ;; Output: ex1:java.lang.Error: my-error cf:#<procedure cf>
  12. ;; Output: caught java.lang.Error: my-error