43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/phusion_passenger/ruby_core_enhancements.rb', line 43
def backtrace_string(current_location = nil)
if current_location.nil?
location = nil
else
location = "in #{current_location} "
end
current_thread = Thread.current
if !(thread_id = current_thread[:id])
current_thread.to_s =~ /:(0x[0-9a-f]+)/i
thread_id = $1 || '?'
end
if thread_name = current_thread[:name]
thread_name = "(#{thread_name})"
end
return "*** Exception #{self.class} #{location}" <<
"(#{self}) (process #{$$}, thread #{thread_id}#{thread_name}):\n" <<
"\tfrom " << backtrace.join("\n\tfrom ")
end
|