DEV Community

Discussion on: "There has been an error"...

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

The correct approach here is to follow two specific rules when handling error messages:

  • Don't tell the user things they already know. Both of your examples of bad error messages violate this one. It's pointless to tell the user something went wrong without telling them what went wrong in more detail than is immediately obvious from what's inherently visible in the UI.
  • Explain why, at least one level deeper than what's inherently obvious whenever possible. "This video can't be loaded." instead of "This video can't be played", "Permission denied attempting to access resource" instead of "Unable to access resource", etc.

The idea here is to give enough information so that someone who has a bit of background with similar services/tools can figure out enough to probably fix it themselves without needing to contact support in some way.