PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Exception
U:RDoc::AnyMethod[iI"backtrace_locations:ETI""Exception#backtrace_locations;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"SReturns the backtrace (the list of code locations that led to the exception), ;TI":as an array of Thread::Backtrace::Location instances.;To:RDoc::Markup::BlankLine o; ; [I"KExample (assuming the code is stored in the file named <tt>t.rb</tt>):;T@o:RDoc::Markup::Verbatim; [I"*def division(numerator, denominator) ;TI" numerator / denominator ;TI" end ;TI" ;TI"begin ;TI" division(1, 0) ;TI"rescue => ex ;TI" p ex.backtrace_locations ;TI"X # ["t.rb:2:in 'Integer#/'", "t.rb:2:in 'Object#division'", "t.rb:6:in '<main>'"] ;TI"* loc = ex.backtrace_locations.first ;TI" p loc.class ;TI"% # Thread::Backtrace::Location ;TI" p loc.path ;TI" # "t.rb" ;TI" p loc.lineno ;TI" # 2 ;TI" p loc.label ;TI" # "Integer#/" ;TI" end ;T:@format0o; ; [I"ZThe value returned by this method might be adjusted when raising (see Kernel#raise), ;TI"7or during intermediate handling by #set_backtrace.;T@o; ; [I"MSee also #backtrace that provide the same value as an array of strings. ;TI"O(Note though that two values might not be consistent with each other when ;TI"'backtraces are manually adjusted.);T@o; ; [I"9See {Backtraces}[rdoc-ref:exceptions.md@Backtraces].;T: @fileI"error.c;T:0@omit_headings_from_table_of_contents_below0I")backtrace_locations -> array or nil ;T0[ I"();T@4FI"Exception;TcRDoc::NormalClass00
[-] set_backtrace-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] to_tty%3f-c.ri
[edit]
[-] to_json-i.ri
[edit]
[-] exception-c.ri
[edit]
[-] message-i.ri
[edit]
[-] exception-i.ri
[edit]
[-] as_json-i.ri
[edit]
[-] backtrace_locations-i.ri
[edit]
[-] new-c.ri
[edit]
[-] cause-i.ri
[edit]
[-] json_create-c.ri
[edit]
[-] full_message-i.ri
[edit]
[-] backtrace-i.ri
[edit]
[-] cdesc-Exception.ri
[edit]
[+]
..
[-] %3d%3d-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] detailed_message-i.ri
[edit]