How to Write Error Messages for Unknown Errors

Unknown errors are the bane of both users and developers. While we strive to anticipate and handle every possible error scenario, sometimes things go wrong in ways we didn't expect. When this happens, we need to write error messages that are helpful without being misleading. Here's how to handle these tricky situations effectively.

April Norhanian

1/22/20252 min read

worm's-eye view photography of concrete building
worm's-eye view photography of concrete building

Unknown errors are the bane of both users and developers. While we strive to anticipate and handle every possible error scenario, sometimes things go wrong in ways we didn't expect. When this happens, we need to write error messages that are helpful without being misleading. Here's how to handle these tricky situations effectively.

Start with Honesty

The worst thing you can do is pretend you know what went wrong when you don't. Users appreciate honesty, even if it means admitting uncertainty. Instead of vague technical jargon, acknowledge the situation directly:

✅ Good: "Something unexpected went wrong." ❌ Bad: "Error code 7592: System process failure"

Provide Context When Possible

Even if you don't know the exact error, you often know what the user was trying to do. Reference this in your message:

✅ Good: "We couldn't save your document. Something unexpected went wrong." ❌ Bad: "Unknown error occurred"

Give Clear Next Steps

Never leave users stranded. Always provide at least one actionable step they can take:

✅ Good: "Something unexpected went wrong while uploading your file. Try again, or if the problem continues, contact our support team." ❌ Bad: "Error: Operation failed"

Include Recovery Options

Offer multiple paths to resolution when possible:

  • Retry the action

  • Refresh the page

  • Clear cache and try again

  • Contact support

  • Return to the previous page

Consider Technical Users

If your product serves technical users, consider including a way to access more detailed error information:

"Something unexpected went wrong while processing your request. [View technical details]"

Write for Emotional State

Remember that users encountering errors are often already frustrated. Keep the tone sympathetic but professional:

✅ Good: "We're sorry, but something unexpected went wrong. We've logged this error and will investigate." ❌ Bad: "Oops! Looks like our system hiccuped! 🤪"

Follow These Key Principles:

  1. Be honest about the uncertainty

  2. Maintain user confidence in the system

  3. Provide clear next steps

  4. Log errors for investigation

  5. Consider the user's emotional state

  6. Avoid technical jargon unless necessary

Implement Progressive Disclosure

Consider using progressive disclosure for error messages. Start with a simple, user-friendly message but provide a way to get more details if needed:

Level 1: "Something unexpected went wrong while saving your changes." Level 2: [Expandable] "Error details: Request timeout in database transaction" Level 3: [Technical log] Full stack trace and error details

Testing Your Error Messages

Before implementing any error message system, test it with real users. Pay attention to:

  • Do users understand what happened?

  • Can they figure out what to do next?

  • Does the message cause additional anxiety or confusion?

  • Is the tone appropriate for the situation?

Conclusion

Writing error messages for unknown errors is challenging, but following these guidelines can help create a better user experience even when things go wrong. Remember that the goal is not just to inform users about the error, but to guide them toward a solution while maintaining their trust in your system.

The best error messages are those that make users feel supported and confident that they can either resolve the issue or get help, even when the system itself is uncertain about what went wrong.