[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

catching exceptions from embedded ruby

Joe Van Dyk

1/13/2006 10:54:00 PM

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?


1 Answer

Joe Van Dyk

1/13/2006 11:15:00 PM

0

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