Manual:$wgExceptionHooks/en

Details
Hooks that are used for outputting exceptions. Format is:

or:

Hooks should return strings or false.