When to Show Error Details

Published

Only show error message details when the user can recover from it. Never show errors that expose backend exceptions or stack traces.

When a user can’t do anything to recover, be clear about it. It’s almost always better to say “Something went wrong, we’re looking into it” than to dump a stack trace for the user to puzzle over.

But what if you really really need that information to figure out the bug? Don’t make your user do it! Use logging and traces to be alerted when an exception occurs and include enough context for an engineer to resolve the issue. If you absolutely must have the user participate, include instructions for how to file a good support ticket. For example, “Something went wrong, please contact support@acme.com and include the following identifier for our team to investigate. {identifier with click to copy}”.