From: Hugh Sasse Date: 2005-11-03T21:55:43+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 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. > > Although the meaning is obvious I had to look up "petard". Did you know > your proverb originates from Shaky? > http://dictionary.reference.com/search?q=petard I thought you meant "Shaking Stevens" for a minute! I know it was Shakespearian in origin, but didn't know about the French and Latin roots. Makes one wonder about "petition"... > > > 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. > > :-)) Silly us - this happens to me once in a while, too. It seems to take so long to figure out. Anyway, now I've a shortcut. > > > 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. > > You're welcome! I'm glad you finally managed to kill the beast. :-) > > Kind regards > > robert > Thank you, Hugh > >