Forum: Ruby catching exceptions from embedded ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2006-01-13 23:55
(Received via mailing list)
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?
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2006-01-14 00:16
(Received via mailing list)
On 1/13/06, Joe Van Dyk <joevandyk@gmail.com> 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)?
This topic is locked and can not be replied to.