我正在使用 exception.io 来获取有关我的 rails 应用程序中发生的所有异常的电子邮件,但是我希望重写所有异常文本,以便电子邮件的主题显示发生错误的 ENV。
目前我们得到这样的东西: appName: Plans Controller# ...更多错误文本
我很想得到这样的东西: appName: DEV::Plans Controller# ...more error text or appName: PROD::Plans Controller# ...more error text
你可以直接连接到应用程序控制器来做这样的事情吗?
class ApplicationController < ActionController::Base
rescue from Exception, with => cool_exception_hook
def cool_exception_hook
//not sure what to do here?
Exception.text = ENV + "::" + Exception.text
//continue executing as before....
end