caller usage and getting a full trace after a rescue on generalException

X

Xeno Campanoli

Say, I'm having a difficult problem getting a complete trace/stack dump. I've
got a place where I do a rescue Exception for anything, and I get the darn raise
string, but not a trace back to the line where it occurred. In fact it appears
my use of rescue is hiding the information I might get otherwise. Can someone
give me some suggestions. My apologies if this should be obvious.

Sincerely, Xeno
 
A

Aaron Patterson

Say, I'm having a difficult problem getting a complete trace/stack dump.
I've got a place where I do a rescue Exception for anything, and I get
the darn raise string, but not a trace back to the line where it
occurred. In fact it appears my use of rescue is hiding the information
I might get otherwise. Can someone give me some suggestions. My
apologies if this should be obvious.

Is Exception#backtrace what you're looking for?

From the RDoc:

def a
raise "boom"
end

def b
a()
end

begin
b()
rescue => detail
print detail.backtrace.join("\n")
end
 
X

Xeno Campanoli

Aaron said:
Is Exception#backtrace what you're looking for?

Yes, thank you very much. That helped. I would have responded sooner, but this
week's death march and all you know.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top