2012-02-01 21 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 })