catching exceptions from embedded ruby

J

Joe Van Dyk

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?
 
J

Joe Van Dyk

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)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,051
Members
47,656
Latest member
rickwatson

Latest Threads

Top