Knowledgebase

Handling Errors Gracefully in Production Print

  • developersgitdeployment, developers, errors, database, password, troubleshooting, guide, howto
  • 0

What visitors see when something fails.

THE RULES

Never display technical errors to visitors. They expose file paths, query fragments and framework versions. Log everything, with enough context to diagnose. Show the visitor something helpful.

A GOOD ERROR PAGE

Says something went wrong in plain language

Offers a way forward: the homepage, search, or contact details

Does not blame the visitor Matches the site design, so it does not look like a hijack

FOR 404s

Genuinely useful: a search box, links to main sections, and the contact details. A well-made 404 recovers visitors that a blank one loses.

LOGGING

Include the URL, the user if logged in, the timestamp, and the stack trace. Without context, a log entry is not actionable.

Send critical errors somewhere you will see them rather than relying on checking a file.

MONITORING ERROR RATES

A sudden increase indicates a problem before users report it.

WHAT NOT TO LOG

Passwords, card details, tokens, or personal data beyond what you need. Logs are frequently less protected than databases.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot