{z: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:#YARD::CodeObjects::ClassObject;IC;[7o; ;IC;[ :@owner@
:@class_mixinsIC;[ ;
@
:@instance_mixinsIC;[ ;
@
:@attributesIC:SymbolHash{:
classIC;{ :@symbolize_valueT:
instanceIC;{ ;T;T:
@aliases{ :@groups[ :@files[[I"ext/strscan/strscan.c:ETi.:@current_file_has_commentsF:
@name:
Error:@source_type: ruby:@visibility:public:
@tags[ :@docstrings{ :@docstringIC:YARD::Docstring" ;T;[ :@ref_tags[ : @allI" ;T:@unresolved_reference0:@object@
:@namespace@:
@pathI"StringScanner::Error;F:@superclasso:YARD::CodeObjects::Proxy:@orignamespace0:@origname0:
@imethod0;:StandardError;%@: @objo; ;IC;[ ;
@;IC;[ ;
@;IC;[ ;
@;
IC;{;IC;{ ;T;IC;{ ;T;T;{ ;[ ;[[I"error.c;Ti| [@)iR;T;;,;;;;;[ ;{ ;IC; "The most standard error types are subclasses of StandardError. A
rescue clause without an explicit Exception class will rescue all
StandardErrors (and only those).
def foo
raise "Oups"
end
foo rescue "Hello" #=> "Hello"
On the other hand:
require 'does/not/exist' rescue "Hi"
raises the exception:
LoadError: no such file to load -- does/not/exist
;T;[ ;![ ;"I"
The most standard error types are subclasses of StandardError. A
rescue clause without an explicit Exception class will rescue all
StandardErrors (and only those).
def foo
raise "Oups"
end
foo rescue "Hello" #=> "Hello"
On the other hand:
require 'does/not/exist' rescue "Hi"
raises the exception:
LoadError: no such file to load -- does/not/exist
;T;#0;$@:@hash_flagF:@line_rangeo:
Range: exclT:
begini| :endi ;%@;&I"StandardError;F;'o; ;IC;[o:$YARD::CodeObjects::MethodObject:@module_functionF:@scope;;;;&I"Exception.exception;F:@parameters[[I"
*args;T0;[[I"
object.c;Ti;T;:exception;0;[ ;{ ;IC; "call-seq:
exc.exception([string]) -> an_exception or exc
With no argument, or if the argument is the same as the receiver,
return the receiver. Otherwise, create a new
exception object of the same class as the receiver, but with a
message equal to string.to_str
.
;T;[ ;![ ;"I"
call-seq:
exc.exception([string]) -> an_exception or exc
With no argument, or if the argument is the same as the receiver,
return the receiver. Otherwise, create a new
exception object of the same class as the receiver, but with a
message equal to string.to_str
.
;T;#0;$@5;.F;/o;0;1T;2i;3i;%@3:@sourceI"VALUE
rb_class_new_instance(int argc, const VALUE *argv, VALUE klass)
{
VALUE obj;
Check_Type(klass, T_CLASS);
obj = rb_class_alloc(klass);
rb_obj_call_init_kw(obj, argc, argv, RB_NO_KEYWORDS);
return obj;
};T:@signatureI"
VALUE;T:@explicitTo;4;5F;6;;;;&I"Exception.to_tty?;F;7[ ;[[@)i;T;:to_tty?;0;[ ;{ ;IC; "@Returns +true+ if exception messages will be sent to a tty.;T;[o:YARD::Tags::OverloadTag
:@tag_nameI"
overload;F:
@text0;;<:@types0;:I"to_tty?;T;IC; " ;T;[o:YARD::Tags::Tag
;>I"return;F;?I" ;T;0;@[I"Boolean;T;$@F;![ ;"I"@return [Boolean];T;#0;$@F;.F:@ref_tag_recurse_counti :
@summary0;7[ ;$@F;![ ;"I"hReturns +true+ if exception messages will be sent to a tty.
@overload to_tty?
@return [Boolean];T;#0;$@F;.F;/o;0;1T;2i;3i;Bi ;%@3;9I"Ustatic VALUE
exc_s_to_tty_p(VALUE self)
{
return RBOOL(rb_stderr_tty_p());
};T;:I"static VALUE;T;;To;4;5F;6;;;;&I"Exception#exception;F;7[[@90;[[@)i;T;;8;0;[ ;{ ;IC; "call-seq:
exc.exception([string]) -> an_exception or exc
With no argument, or if the argument is the same as the receiver,
return the receiver. Otherwise, create a new
exception object of the same class as the receiver, but with a
message equal to string.to_str
.
;T;[ ;![ ;"@B;#0;$@a;.F;/o;0;1T;2i;3i;%@3;9I"!static VALUE
exc_exception(int argc, VALUE *argv, VALUE self)
{
VALUE exc;
argc = rb_check_arity(argc, 0, 1);
if (argc == 0) return self;
if (argc == 1 && self == argv[0]) return self;
exc = rb_obj_clone(self);
rb_ivar_set(exc, id_mesg, argv[0]);
return exc;
};T;:I"static VALUE;T;;To;4;5F;6;;;;&I"Exception#initialize;F;7[[@90;[[@)i;T;:initialize;0;[ ;{ ;IC; "HConstruct a new Exception object, optionally passing in
a message.
;T;[o;=
;>I"
overload;F;?0;:new;@0;:I"new(msg = nil);T;IC; " ;T;[o;A
;>I"return;F;?I" ;T;0;@[I"Exception;T;$@o;![ ;"I"@return [Exception];T;#0;$@o;.F;Bi ;C0;7[[I"msg;TI"nil;T;$@oo;=
;>I"
overload;F;?0;;8;@0;:I"exception(msg = nil);T;IC; " ;T;[o;A
;>I"return;F;?I" ;T;0;@[I"Exception;T;$@o;![ ;"I"@return [Exception];T;#0;$@o;.F;Bi ;C0;7[[I"msg;TI"nil;T;$@o;![ ;"I" Construct a new Exception object, optionally passing in
a message.
@overload new(msg = nil)
@return [Exception]
@overload exception(msg = nil)
@return [Exception];T;#0;$@o;.F;/o;0;1T;2i;3i;%@3;9I"static VALUE
exc_initialize(int argc, VALUE *argv, VALUE exc)
{
VALUE arg;
arg = (!rb_check_arity(argc, 0, 1) ? Qnil : argv[0]);
return exc_init(exc, arg);
};T;:I"static VALUE;T;;To;4;5F;6;;;;&I"Exception#==;F;7[[I"obj;T0;[[@)i;T;:==;0;[ ;{ ;IC; "Equality---If obj is not an Exception, returns
false
. Otherwise, returns true
if exc and
obj share same class, messages, and backtrace.
;T;[o;=
;>I"
overload;F;?0;;F;@0;:I"==(obj);T;IC; " ;T;[o;A
;>I"return;F;?I" ;T;0;@[I"Boolean;T;$@;![ ;"I"@return [Boolean];T;#0;$@;.F;Bi ;C0;7[[I"obj;T0;$@;![ ;"I"Equality---If obj is not an Exception, returns
false
. Otherwise, returns true
if exc and
obj share same class, messages, and backtrace.
@overload ==(obj)
@return [Boolean];T;#0;$@;.F;/o;0;1T;2i;3i;%@3;9I"static VALUE
exc_equal(VALUE exc, VALUE obj)
{
VALUE mesg, backtrace;
if (exc == obj) return Qtrue;
if (rb_obj_class(exc) != rb_obj_class(obj)) {
int state;
obj = rb_protect(try_convert_to_exception, obj, &state);
if (state || obj == Qundef) {
rb_set_errinfo(Qnil);
return Qfalse;
}
if (rb_obj_class(exc) != rb_obj_class(obj)) return Qfalse;
mesg = rb_check_funcall(obj, id_message, 0, 0);
if (mesg == Qundef) return Qfalse;
backtrace = rb_check_funcall(obj, id_backtrace, 0, 0);
if (backtrace == Qundef) return Qfalse;
}
else {
mesg = rb_attr_get(obj, id_mesg);
backtrace = exc_backtrace(obj);
}
if (!rb_equal(rb_attr_get(exc, id_mesg), mesg))
return Qfalse;
return rb_equal(exc_backtrace(exc), backtrace);
};T;:I"static VALUE;T;;To;4;5F;6;;;;&I"Exception#to_s;F;7[ ;[[@)i;T;: to_s;0;[ ;{ ;IC; "UReturns exception's message (or the name of the exception if
no message is set).
;T;[o;=
;>I"
overload;F;?0;;G;@0;:I" to_s;T;IC; " ;T;[o;A
;>I"return;F;?I" ;T;0;@[I"String;T;$@;![ ;"I"@return [String];T;#0;$@;.F;Bi ;C0;7[ ;$@;![ ;"I"yReturns exception's message (or the name of the exception if
no message is set).
@overload to_s
@return [String];T;#0;$@;.F;/o;0;1T;2i;3i;%@3;9I"static VALUE
exc_to_s(VALUE exc)
{
VALUE mesg = rb_attr_get(exc, idMesg);
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
return rb_String(mesg);
};T;:I"static VALUE;T;;To;4;5F;6;;;;&I"Exception#message;F;7[ ;[[@)i(;T;:message;0;[ ;{ ;IC; "wReturns the result of invoking exception.to_s
.
Normally this returns the exception's message or name.
;T;[o;=
;>I"
overload;F;?0;;H;@0;:I"message;T;IC; " ;T;[o;A
;>I"return;F;?I" ;T;0;@[I"String;T;$@;![ ;"I"@return [String];T;#0;$@;.F;Bi ;C0;7[ ;$@;![ ;"I"Returns the result of invoking exception.to_s
.
Normally this returns the exception's message or name.
@overload message
@return [String];T;#0;$@;.F;/o;0;1T;2i ;3i%;%@3;9I"Wstatic VALUE
exc_message(VALUE exc)
{
return rb_funcallv(exc, idTo_s, 0, 0);
};T;:I"static VALUE;T;;To;4;5F;6;;;;&I"Exception#full_message;F;7[[@90;[[@)i;T;:full_message;0;[ ;{ ;IC; "Returns formatted string of _exception_.
The returned string is formatted using the same format that Ruby uses
when printing an uncaught exceptions to stderr.
If _highlight_ is +true+ the default error handler will send the
messages to a tty.
_order_ must be either of +:top+ or +:bottom+, and places the error
message and the innermost backtrace come at the top or the bottom.
The default values of these options depend on $stderr
and its +tty?+ at the timing of a call.
;T;[o;=
;>I"
overload;F;?0;;I;@0;:I"