File: //usr/share/ri/3.0.0/system/Exception/cdesc-Exception.ri
U:RDoc::NormalClass[iI"Exception:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[#o:RDoc::Markup::Paragraph;[I"I\Class Exception and its subclasses are used to communicate between ;TI"OKernel#raise and +rescue+ statements in <code>begin ... end</code> blocks.;To:RDoc::Markup::BlankLine o; ;[I"@An Exception object carries information about an exception:;To:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"&Its type (the exception's class).;To;;0;[o; ;[I"%An optional descriptive message.;To;;0;[o; ;[I"$Optional backtrace information.;T@o; ;[I"YSome built-in subclasses of Exception have additional methods: e.g., NameError#name.;T@S:RDoc::Markup::Heading:
leveli: textI"
Defaults;T@o; ;[I"8Two Ruby statements have default exception classes:;To;;;
;[o;;0;[o; ;[I"'+raise+: defaults to RuntimeError.;To;;0;[o; ;[I")+rescue+: defaults to StandardError.;T@S;;i;I"Global Variables;T@o; ;[I"IWhen an exception has been raised but not yet handled (in +rescue+, ;TI"I+ensure+, +at_exit+ and +END+ blocks), two global variables are set:;To;;;
;[o;;0;[o; ;[I"4<code>$!</code> contains the current exception.;To;;0;[o; ;[I",<code>$@</code> contains its backtrace.;T@S;;i;I"Custom Exceptions;T@o; ;[I"5To provide additional or alternate information, ;TI"3a program may create custom exception classes ;TI"5that derive from the built-in exception classes.;T@o; ;[I"SA good practice is for a library to create a single "generic" exception class ;TI"=(typically a subclass of StandardError or RuntimeError) ;TI"Band have its other exception classes derive from that class. ;TI"XThis allows the user to rescue the generic exception, thus catching all exceptions ;TI"Jthe library may raise even if future versions of the library add new ;TI"exception subclasses.;T@o; ;[I"For example:;T@o:RDoc::Markup::Verbatim;[I"class MyLibrary
;TI"% class Error < ::StandardError
;TI" end
;TI"
;TI"! class WidgetError < Error
;TI" end
;TI"
;TI" class FrobError < Error
;TI" end
;TI"
;TI" end
;T:@format0o; ;[I"PTo handle both MyLibrary::WidgetError and MyLibrary::FrobError the library ;TI"&user can rescue MyLibrary::Error.;T@S;;i;I"Built-In Exception Classes;T@o; ;[I".The built-in subclasses of Exception are:;T@o;;;
;[
o;;0;[o; ;[I"NoMemoryError;To;;0;[o; ;[I"ScriptError;To;;;
;[o;;0;[o; ;[I"LoadError;To;;0;[o; ;[I"NotImplementedError;To;;0;[o; ;[I"SyntaxError;To;;0;[o; ;[I"SecurityError;To;;0;[o; ;[I"SignalException;To;;;
;[o;;0;[o; ;[I"Interrupt;To;;0;[o; ;[I"StandardError;To;;;
;[o;;0;[o; ;[I"ArgumentError;To;;;
;[o;;0;[o; ;[I"UncaughtThrowError;To;;0;[o; ;[I"EncodingError;To;;0;[o; ;[I"FiberError;To;;0;[o; ;[I"IOError;To;;;
;[o;;0;[o; ;[I"
EOFError;To;;0;[o; ;[I"IndexError;To;;;
;[o;;0;[o; ;[I"
KeyError;To;;0;[o; ;[I"StopIteration;To;;;
;[o;;0;[o; ;[I"ClosedQueueError;To;;0;[o; ;[I"LocalJumpError;To;;0;[o; ;[I"NameError;To;;;
;[o;;0;[o; ;[I"NoMethodError;To;;0;[o; ;[I"RangeError;To;;;
;[o;;0;[o; ;[I"FloatDomainError;To;;0;[o; ;[I"RegexpError;To;;0;[o; ;[I"RuntimeError;To;;;
;[o;;0;[o; ;[I"FrozenError;To;;0;[o; ;[I"SystemCallError;To;;;
;[o;;0;[o; ;[I"
Errno::*;To;;0;[o; ;[I"ThreadError;To;;0;[o; ;[I"TypeError;To;;0;[o; ;[I"ZeroDivisionError;To;;0;[o; ;[I"SystemExit;To;;0;[o; ;[I"SystemStackError;To;;0;[o; ;[I"
fatal;T:
@fileI"error.c;T:0@omit_headings_from_table_of_contents_below0o;;[ ;I"'ext/json/lib/json/add/exception.rb;T;0;0;0[ [ [ [[I"
class;T[[:public[ [I"exception;TI"error.c;T[I"json_create;TI"'ext/json/lib/json/add/exception.rb;T[I"new;T@E[I"to_tty?;T@E[:protected[ [:private[ [I"
instance;T[[;[[I"==;T@E[I"as_json;T@H[I"backtrace;T@E[I"backtrace_locations;T@E[I"
cause;T@E[I"exception;T@E[I"full_message;T@E[I"inspect;T@E[I"message;T@E[I"set_backtrace;T@E[I"to_json;T@H[I" to_s;T@E[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@6@9@9cRDoc::TopLevel