[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Error/exception documentation

Chris Donhofer

9/25/2006 2:55:00 PM

hi!

browsing through the ruby documentation(http://www.ruby-doc...),
i noticed that there was no info on which errors might be thrown by a
method.

since error/exception handling is necessary for coding robust programs,
i believe there must be a more detailed ruby documentation/reference.
where can i find a document that includes this info?

cheers, chris

3 Answers

Chris Donhofer

9/25/2006 3:35:00 PM

0

i just noticed that there are some notes on errors raise, but some
functions that i expect to throw an error, f.i. copy_file, don't.
how come there's not an IOError or something like it?

Chris Donhofer wrote:
> hi!
>
> browsing through the ruby documentation(http://www.ruby-doc...),
> i noticed that there was no info on which errors might be thrown by a
> method.
>
> since error/exception handling is necessary for coding robust programs,
> i believe there must be a more detailed ruby documentation/reference.
> where can i find a document that includes this info?
>
> cheers, chris
>

Jano Svitok

9/25/2006 3:55:00 PM

0

On 9/25/06, Chris Donhofer <c.donhofer@chello.at> wrote:
> i just noticed that there are some notes on errors raise, but some
> functions that i expect to throw an error, f.i. copy_file, don't.
> how come there's not an IOError or something like it?

In that particular case, you'll likely encounter Errno::* exceptions.
For a list of (core) defined exceptions, see Programming Ruby, or Ruby QuickRef.

Or, require all the libs, and use ObjectSpace.each_object(Exception) {
|e| puts e.name }

That will obviously not give you info on what will a particular method
raise, just what exceptions are there.

J.

Chris Donhofer

9/25/2006 4:56:00 PM

0

thx jan, i'll have a look at it.
i still believe it would be better to have this information included in
each method description since it really shouldn't take more than a few
seconds to look it up. =)

cheers, chris

Jan Svitok wrote:

> On 9/25/06, Chris Donhofer <c.donhofer@chello.at> wrote:
>
>> i just noticed that there are some notes on errors raise, but some
>> functions that i expect to throw an error, f.i. copy_file, don't.
>> how come there's not an IOError or something like it?
>
>
> In that particular case, you'll likely encounter Errno::* exceptions.
> For a list of (core) defined exceptions, see Programming Ruby, or Ruby
> QuickRef.
>
> Or, require all the libs, and use ObjectSpace.each_object(Exception) {
> |e| puts e.name }
>
> That will obviously not give you info on what will a particular method
> raise, just what exceptions are there.
>
> J.
>