On this page:

10 Exceptions

 (require (planet cce/scheme:7:0/exn))

This module provides tools for dealing with exceptions.

(try expr ...+)
Executes the first expression expr in the sequence, producing its result value(s) if it returns any. If it raises an exception instead, try continues with the next expr. Exceptions raised by intermediate expressions are reported to the current logger at the 'debug level before continuing. Exceptions raised by the final expression are not caught by try.


  > (try (+ 1 2) (+ 3 4))


  > (try (+ 'one 'two) (+ 3 4))


  > (try (+ 'one 'two) (+ 'three 'four))

  +: expects type <number> as 1st argument, given: 'three;

  other arguments were: 'four