Error/exception documentation

C

Chris Donhofer

hi!

browsing through the ruby documentation(http://www.ruby-doc.org/core/),
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
 
C

Chris Donhofer

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

Jan Svitok

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.
 
C

Chris Donhofer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top