4

I have an HTML5 offline app and on occasion users have cache errors which I handle with the event listener and display a generic error message.

In order to help debug these I'd like to also display and log the error details (as seen in the Chrome console), such as a failed get. I have not yet found a way to get the details through Javascript. Is this currently possible?

sreimer
  • 4,913
  • 2
  • 33
  • 43

1 Answers1

0

Probably something like this:

var appCache = window.applicationCache;
    function handleCacheError(e){
          console.log(e);
    }
    appCache.addEventListener('error', handleCacheError, false);

And then you should have the error logged to the Chrome console on error.

nobody
  • 7,803
  • 11
  • 56
  • 91
  • The event parameter `e` does not contain the actual cause of the error which is what I'm trying to get (eg. GET failed on which file?) – sreimer Feb 19 '14 at 17:17