我第一次尝试使用exception_notification.我观看了Railscast并遵循了作者在http://smartinez87.github.io/exception_notification/中的说明.一切似乎在某些例外情况下工作正常,但与其他情况不同.
我测试和错误,如收到的电子邮件错误notificatios从我的开发环境"An ActionView::Template::Error occurred in static_pages#home:
."不过,也有一些例外,如RoutingException
和RecordNotFound
那些不被逮住ExceptionNotification,我不知道为什么,因为我没有任何rescue_from策略我的application_controller中的任何一种.
我正在使用rails 3.2.12并检查中间件堆栈数组,我可以看到ExceptionNotification只是最后一个,并且似乎某种异常不会在堆栈中出现,所以Exception Notification不知道他们.
所以,问题是:我做错了什么? ExceptionNotification 之间有什么区别ActionController::RoutingError
或者ActiveRecord::RecordNotFound
哪些不被捕获,ActionView::Template::Error
哪些被捕获并导致异常通知将通知电子邮件发送到我的收件箱.
提前致谢
exception-handling ruby-on-rails rack-middleware exception-notification