将 BackTrace 添加到 Hoptoad Notify 方法
我的代码如下所示:
raise "Invalid destination "
rescue Exception => e
HoptoadNotifier.notify(:error_class => e, :error_message => "#{e} : Error occured for the user #{self.user_name}")
我实际上希望在 hoptoad 中将错误消息记录为 “无效目的地:用户用户名发生错误”
。如上所示的代码按预期工作。但我无法在 hoptoad 中获取回溯。请就此提出建议。
I have the code as shown below:
raise "Invalid destination "
rescue Exception => e
HoptoadNotifier.notify(:error_class => e, :error_message => "#{e} : Error occured for the user #{self.user_name}")
I actually want the error message to be logged in the hoptoad as "Invalid destination : Error occured for the user username"
. The code as shown above works as intented. But im not able to get the back trace in the hoptoad. Please suggest on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显式地将
e.backtrace
传递给Hoptoad.nofity
:Explicitly pass
e.backtrace
toHoptoad.nofity
: