From: Tim Hunter Date: 2005-04-05T04:29:44+09:00 Subject: Re: Extension question Joe Van Dyk wrote: > How should errors be handled in C extensions? For example, my C > extension was expecting a Ruby string, but it was passed an IO object. Generally the Ruby functions that convert Ruby types to C types will raise an exception if they're given invalid input. > > Or, what should I do when I try to open a file in C (the filename > being passed to the function) and the file doesn't exist? > Call rb_raise() Check out chapter 21 in the new Pickaxe.