# Queries regarding ruby exception handling

**URL:** <https://www.ruby-forum.com/t/queries-regarding-ruby-exception-handling/133844>\
**Category:** Ruby\
**Created:** [April 4, 2008, 9:09am UTC](https://www.ruby-forum.com/t/queries-regarding-ruby-exception-handling/133844 "2008-04-04T09:09:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chirag\_mistry\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ec9cab/32.png) [@chirag\_mistry\_ruby](https://www.ruby-forum.com/u/chirag_mistry_ruby)\
**Post date:** [April 4, 2008, 9:09am UTC](https://www.ruby-forum.com/t/queries-regarding-ruby-exception-handling/133844/1 "2008-04-04T09:09:19Z")

</div>

Hi

I am using Ruby 1.8.6 in embedded with C++ application and in future I  
will use Ruby 1.9. I have following queries for Ruby exception handling.  
Please give reply with the answers or provide me information about any  
reference document that can help me for the same.

1. We can catch and handle Ruby exceptions using rb\_protect C API. Is  
there any other way or other C APIs to do the same things?
2. From following list of Ruby C APIs:

- Which API can throw Ruby exception or any other exception?
- If any API is throwing exception then which exception and in which  
condition?

List of C APIs that I am using:  
rb\_require  
rb\_gv\_get  
rb\_obj\_call\_init  
rb\_exc\_raise  
rb\_funcall  
rb\_funcall3  
rb\_intern  
Data\_Get\_Struct  
Data\_Wrap\_Struct  
rb\_iv\_set  
rb\_iv\_get  
rb\_obj\_is\_instance\_of  
rb\_define\_class  
rb\_define\_class\_under  
rb\_define\_const  
rb\_const\_get  
rb\_ary\_shift  
rb\_ary\_new2  
rb\_ary\_store  
rb\_class\_new\_instance  
rb\_define\_module  
rb\_define\_module\_under  
rb\_define\_method  
rb\_define\_singleton\_method  
rb\_ivar\_defined  
rb\_float\_new  
rb\_str\_new2  
RSTRING  
RARRAY

Regards  
Chirag
