Even the most tested and analyzed stie will have a few problems now and then, and that's okay. The poblem lies in how you handle those errors.
It's standard practice to create a least 404.html and 500.html templates
We suggest serving your error pages from a static file server (eg. Nginx or Apache) as entirely self-contained static HTML files.