aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-07-22 14:02:39 -0700
committerJeremy Evans <code@jeremyevans.net>2019-07-22 14:02:39 -0700
commitc1ad6321b03bcf9f96f975bcba7ff1d205990149 (patch)
treecd16af2b821e8b79aaab5d0259f8bc3e1d1844cb /eval.c
parentd2710ba86677380f016b6a84d81e5cb39837c04d (diff)
downloadruby-c1ad6321b03bcf9f96f975bcba7ff1d205990149.tar.gz
Adjust documentation for Kernel#raise [ci skip]
Mention how each of the arguments are retrievable from the generated Exception object. Fixes [Bug #10110]
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/eval.c b/eval.c
index afc78532df..437838207c 100644
--- a/eval.c
+++ b/eval.c
@@ -714,23 +714,23 @@ extract_raise_opts(int argc, const VALUE *argv, VALUE *opts)
* fail(exception [, string [, array]], cause: $!)
*
* With no arguments, raises the exception in <code>$!</code> or raises
- * a RuntimeError if <code>$!</code> 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 <code>begin...end</code> blocks.
+ * a RuntimeError if <code>$!</code> is +nil+. With a single +String+
+ * argument, raises a +RuntimeError+ with the string as a message. Otherwise,
+ * the first parameter should be an +Exception+ class (or another
+ * object that returns an +Exception+ object when sent an +exception+
+ * message). The optional second parameter sets the message associated with
+ * the exception (accessible via Exception#message), and the third parameter
+ * is an array of callback information (accessible via Exception#backtrace).
+ * The +cause+ of the generated exception (accessible via Exception#cause)
+ * is automatically set to the "current" exception (<code>$!</code>), if any.
+ * An alternative value, either an +Exception+ object or +nil+, can be
+ * specified via the +:cause+ argument.
+ *
+ * Exceptions are caught by the +rescue+ clause of
+ * <code>begin...end</code> blocks.
*
* raise "Failed to create socket"
* raise ArgumentError, "No parameters", caller
- *
- * The +cause+ of the generated exception is automatically set to the
- * "current" exception (<code>$!</code>) if any. An alternative
- * value, either an +Exception+ object or +nil+, can be specified via
- * the +:cause+ argument.
*/
VALUE