Modify Class or Module Responsible for Rails Errors (See Attached Image Example)

Hey Rails Friends,

I generated this error on purpose in the reference image below (Rails 2.7.0) as an example only. The particular error is not important. I just want to modify the base class which generates this message.

Today I searched for quite some time to find the best place to override the method which generates this these types of fatal error HTML message in Rails so I can add some action to it. I do not want to install a gem, instantiate a custom logger, etc. I simply want to override this core method in my application to perform a custom method.

At first, I tried to class_eval in the application controller with a callback with Logger and other modules and classes, but no joy. I must be brain dead because normally I can easily find the class and modify it.

Any direction not asking me to install a gem or instantiate a new logger are much appreciated. Thanks.