On this page:
network-error
exn->string
try
Version: 5.1

8 Exceptions

 (require unstable/exn)

This library is unstable; compatibility will not be maintained. See Unstable for more information.

(network-error s fmt v ...)  void
  s : symbol?
  fmt : string?
  v : any/c
Like error, but throws a exn:fail:network.

(exn->string exn)  string?
  exn : (or/c exn? any/c)
Formats exn with (error-display-handler) as a string.

The subsequent bindings were added by Carl Eastlund <cce@racket-lang.org>.

(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.

Examples:

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

  3

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

  7

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

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

  other arguments were: 'four