Middleware for sending error emails on any response code.