title: More info about reason for JavaScript Image onerror
body: <p>I am constructing an Image in JavaScript to load an image, including providing an onerror function in case something goes wrong.  In that case, I would like more information about the cause of the error, e.g., is the image missing, or was there a network problem, security restriction,...</p>
  
  <p>Server-side, I am not just serving static images, I am actually using PHP to do some checks first.  Ideally, I would like my server to send an image if it can, but if not, provide some kind of custom text message.</p>
  
  <p>The onerror() function does not seem to provide any extra information, other than firing or not. I can ask the server for more info in a separate call, but my code would be much simpler if it could access the information already sent and received.</p>
  
  <p>Can I get more information (ANY information) about the reason for onerror() firing?  Can I send a custom error message from PHP that JavaScript can access?</p>