2012-02-01 53 views
1

我的代码,如下所示:添加回溯到黾通知方法

raise "Invalid destination " 
rescue Exception => e 
     HoptoadNotifier.notify(:error_class => e, :error_message => "#{e} : Error occured for the user #{self.user_name}") 

我实际上要在黾作为"Invalid destination : Error occured for the user username"要记录的错误消息。上面显示的代码的工作原理如图所示。但我不能在hop get中找回背部痕迹。请在此建议。

回答

2

明确地传递给e.backtraceHoptoad.nofity

raise "Invalid destination " 
rescue Exception => e 
    HoptoadNotifier.notify(:error_class => e, :error_message => "#{e} : Error occured for the user #{self.user_name}", :parameters => { backtrace => e.backtrace })