私は私のレールアプリで発生したすべての例外の電子メールを取得するためにexception.ioを使用していますが、電子メールの件名にエラーが発生したENVが表示されるように、すべての例外テキストを書き直したいと思っていました。
現在、次のようなメッセージが表示されます: appName: Plans Controller# ...その他のエラー テキスト
次のようなものが欲しいです: appName: DEV::Plans Controller# ...more error text または 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