Document the "cause" keyword argument for raise
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
72c62dc086
commit
e69dbc0961
13
eval.c
13
eval.c
@ -706,11 +706,11 @@ extract_raise_opts(int argc, const VALUE *argv, VALUE *opts)
|
|||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* raise
|
* raise
|
||||||
* raise(string)
|
* raise(string, cause: $!)
|
||||||
* raise(exception [, string [, array]])
|
* raise(exception [, string [, array]], cause: $!)
|
||||||
* fail
|
* fail
|
||||||
* fail(string)
|
* fail(string, cause: $!)
|
||||||
* fail(exception [, string [, array]])
|
* fail(exception [, string [, array]], cause: $!)
|
||||||
*
|
*
|
||||||
* With no arguments, raises the exception in <code>$!</code> or raises
|
* With no arguments, raises the exception in <code>$!</code> or raises
|
||||||
* a <code>RuntimeError</code> if <code>$!</code> is +nil+.
|
* a <code>RuntimeError</code> if <code>$!</code> is +nil+.
|
||||||
@ -725,6 +725,11 @@ extract_raise_opts(int argc, const VALUE *argv, VALUE *opts)
|
|||||||
*
|
*
|
||||||
* raise "Failed to create socket"
|
* raise "Failed to create socket"
|
||||||
* raise ArgumentError, "No parameters", caller
|
* 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user