[plt-scheme] exception handling

From: Eli Barzilay (eli at barzilay.org)
Date: Sat May 16 14:50:07 EDT 2009

On May 16, wooks wrote:
> I wish to execute a command and trap the exception it raises on
> failure - I'm not interested in the exception, just don't want my
> script to fail. After reading about call-exception-handler in the
> docs I am still not clear how to do this.
> 
> I've got (call-with-exeption-handler f thunk) but trapping the error
> with the function f doesn't stop the script from failing.

Using plain `with-handlers' should do that.  (But be careful --
catching all exceptions is a bad idea, since your real bugs will be
caught too; it's better to use this on as little code as possible, and
use the most specific predicate.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.