guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to transparently re-throw?


From: Dirk Herrmann
Subject: Re: Is there a way to transparently re-throw?
Date: Fri, 2 Mar 2001 10:49:33 +0100 (MET)

On Thu, 1 Mar 2001, Keisuke Nishida wrote:

> At 27 Feb 2001 12:00:44 -0600,
> Rob Browning wrote:
> > 
> > I was trying to set up a catch handler that would catch all
> > exceptions, take some cleanup action, and then, if the error wasn't
> > one the handler was particularly interested in, re-throw the error
> > *without* affecting the error's source.
> 
> Why don't you use dynamic-wind?

It is still interesting to know how one could implement a 'rethrow'
function.  I actually have an application for such a function in the test
suite:  I want to check, whether for some wrong code guile will throw a
misc-error:bad-bindings.  Thus, I have to catch all misc-errors and then
check if this particular misc-error is actually a bad-binding error.  If
this is happening, then the test is said to pass.  If some other
misc-error is thrown, I want to re-throw it to signal an error to the
outer loop.  It would be nice if with the re-throw the original source of
the error was remembered.

Best regards,
Dirk Herrmann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]