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.
Merge pull request #2018 from ErisDS/issue-1991

Catch errors when rendering the error template