On Wed, 17 Oct 2001, ts wrote:

> >>>>> "P" == Paul Brannan <pbrannan / atdesk.com> writes:
>
> P> Generally speaking, you don't need to actually catch the exception; in
> P> fact, rb_ensure() will do just fine.  It's not 100% convenient, because
> P> you still have to break your function into multiple little functions.
>
>  Except if ruby is embedded in an application and in this case it just
>  crash the application.
>
> Guy Decoux

Assuming that by "crash" you mean "segfault," the application will only
crash if an exception occurs before the call to ruby_run().  If you call
ruby_run(), and your script calls a C function that raises an exception,
then the exception will be handled just as it would with a normal ruby
script (that is, if you don't handle the exception at some level, then you
will see the infamous exception+backtrace message sent to stderr, Ruby
will clean up, and your program will exit).

Generally, unless you know exactly what to do to handle an exception, you
should try to remain exception-neutral and pass the exception to the
caller.

Paul