1

私は以下に示すようなコードを持っています:

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

実際には、エラー メッセージを hoptoad に として記録したいと考えています"Invalid destination : Error occured for the user username"。上記のコードは意図したとおりに機能します。しかし、ホップトードでバックトレースを取得できません。これについて提案してください。

4

1 に答える 1

2

に明示的に渡しe.backtraceますHoptoad.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 に答える