[Backgroundrb-devel] Debugging a worker?

Ezra Zygmuntowicz ezmobius at gmail.com
Sun Aug 6 16:54:09 EDT 2006

On Aug 6, 2006, at 1:42 PM, Ben Johnson wrote:

> If there is an exception raised in my worker I rescue it and throw  
> it into the log. This is decent, but it would really help to find  
> out more information. Like the line number, the stack trace, etc.  
> Is this possible?
> Thanks for your help.
> Thank You,
> Ben Johnson
> E: bjohnson at contuitive.com

Hey Ben-

	If I understand what you want I think you can use the same thing I  
use to rescue and print the stack trace to the log file. Like this in  
your worker wherever you do a recuse:

            #something that might raise
         rescue Exception => e
           @logger.error "#{ e.message } - (#{ e.class })" << "\n" <<  
(e.backtrace or []).join("\n")

	Does that help or am I misunderstanding?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060806/f8e6903e/attachment.html 

More information about the Backgroundrb-devel mailing list