From: Hugh Sasse Date: 2005-11-03T20:53:13+09:00 Subject: Re: Trapping errors. On Thu, 3 Nov 2005, Robert Klemme wrote: > Hugh Sasse wrote: > > On Thu, 3 Nov 2005, Robert Klemme wrote: > > > >> This sounds really strange. Here's what I'd do: use set_trace_func > >> to write out all method invocations, returns and thread ids and try > >> to see where it goes. HTH > > > > Good job I tried to add docs to profiler.rb in stdlib yesterday. > > I'll have a go at that. I've not played with set_trace_func before, > > so it should be interesting. > > This should get you started: > > set_trace_func lambda {|event, file, line, id, binding, classname| > $stderr.printf "th %10d: %-10s %s: %d\n", Thread.current.object_id, > event, file, line if > /call|return/ =~ event > } > > Good luck! thanks. It did the trick. I was hoisted by my own petard. begin copy_entry s, d, options[:preserve], options[:dereference_root] rescue Exception, SystemCallError => e stop = true if block_given? stop = yield s,d,e end raise if stop end Yes, I forgot to return nil from the *flaming* block! So it re-raised because stop was true. I didn't realize set_trace_func could be so useful. I'd previously considered it obscure. Thank you for helping me out with this. > > robert > Hugh