[plt-scheme] Re: exception handling
On May 16, 7:50 pm, Eli Barzilay <e... at barzilay.org> wrote:
> 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.)
>
Don't understand the explanation in the docs. Looks complicated and
what I want to do is real simple. Ignore the exception and carry on.
Don't understand why I need with-handlers since I don't want to do
anything with the exception. Don't understand why I'm being asked for
a predicate. Tried it anyway and kept getting errors until and then
the application hung... methinks I will leave this alone.