Catch errors when rendering the error template

fixes #1991

- if there's an error when rendering the error template, default to sending a plain response detailing both errors.