异常通知gem“错误:无法生成异常摘要”

时间:2012-08-26 00:19:03

标签: ruby-on-rails ruby ruby-on-rails-3 exception-handling gem

现在使用exception-notification gem已经成功了一段时间,但是在实际错误之后,我对每个电子邮件正文顶部的电子邮件中的条目感到恼火。问题文本是:

-------------------------------
Request:
-------------------------------

 ERROR: Failed to generate exception summary:

 ActionView::Template::Error: Missing rack.input

接下来的几行甚至总是一样的。这表明了什么?如何解决问题,以便在有意义的任何内容上升到堆栈跟踪的顶部之前我不再看到此错误?

1 个答案:

答案 0 :(得分:2)

这意味着ExceptionNotifier在生成this file时遇到问题。当您自定义发送给它的数据时,通常会发生这种情况。你可以在问题中添加中间件配置*,这样我们就可以看出这是不是问题了?另外,你能确认哪个版本的Rails&您正在使用的异常通知,以及您在请求环境中设置任何自定义数据**

* 它应该看起来像这样

Whatever::Application.config.middleware.use ExceptionNotifier,
  :email_prefix => "[Whatever] ",
  :sender_address => %{"notifier" <notifier@example.com>},
  :exception_recipients => %w{exceptions@example.com}

**之前过滤器中的类似内容

request.env["exception_notifier.exception_data"] = { ... }