I guess everyone here agrees that the best error message is no error message.

But if it is not avoidable, then it should be easily recognizable and contain:

 - the critical information which is a
   text about the situation (can be both human and technical, depends on the audience)
 - ideally an appropriate follow-up
   action to give useful choices

Google Chrome might be a good example for your needs. Try to load a website in [offline mode][1].
Additionally, here is an inspiring collection: https://www.flickr.com/groups/web20error


  [1]: https://developers.google.com/web/tools/chrome-devtools/network-performance/network-conditions#network-conditions