Catching exceptions from embedded ruby


#1

I’m embedding Ruby in a C program. If the Ruby program throws an
exception, I’d like to catch it and print out the error. How could I
do that?


#2

On 1/13/06, Joe Van D. removed_email_address@domain.invalid wrote:

I’m embedding Ruby in a C program. If the Ruby program throws an
exception, I’d like to catch it and print out the error. How could I
do that?

I can protect the function that might return an exception (via
rb_protect), but how can I display the reason why the exception was
thrown (hopefully along with a backtrace)?