0

我正在使用 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
4

1 回答 1

0

您会想要使用 Exceptional.context。请参阅:http: //support.exceptional.io/kb/extras/sending-extra-data-to-exceptional

另外,看看这个如何过滤或注入的例子:http: //support.exceptional.io/kb/extras/filtering-sensitive-data

于 2013-05-07T18:35:27.317 回答