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". 上面显示的代码按预期工作。但我无法在 hoptoad 中获得回溯。请就此提出建议。

4

1 回答 1

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 })
于 2012-02-01T17:05:37.723 回答