Project

General

Profile

Actions

Bug #10110

closed

Exception handling is not well documented

Added by rosenfeld (Rodrigo Rosenfeld Rosas) over 7 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
2.1.2
[ruby-core:64192]

Description

Exception#cause has no documentation at all:

http://www.ruby-doc.org/core-2.1.2/Exception.html#method-i-cause

This is the documentation for Kernel.raise:

With no arguments, raises the exception in $! or raises a RuntimeError if $! is nil. With a single String argument, raises a RuntimeError with the string as a message. Otherwise, the first parameter should be the name of an Exception class (or an object that returns an Exception object when sent an exception message). The optional second parameter sets the message associated with the exception, and the third parameter is an array of callback information. Exceptions are caught by the rescue clause of begin...end blocks.

It's not clear how to get this last argument, i.e., the "callback information". What is a callback information? Does this relate to Exception#cause or Exception#backtrace?

This is all very confusing to me and it would help if someone could please make it clear...

Actions

Also available in: Atom PDF