Serve static file on response status 500

I want to serve static file like errorfile when response status is 500.

I don’t understand, why would errorfile not work for you?