title: How to handle QuotaExceededError in Service worker registration process?
body: <p>I am getting the following error on startup of my website. This error I see in the chrome://serviceworker-internals/ log. I have attached a picture of it.</p>
  
  <p><a href="https://i.stack.imgur.com/hnkXJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hnkXJ.png" alt="enter image description here"></a></p>
  
  <pre><code>Error: {"columnNumber":-1,"lineNumber":-1,"message":"ServiceWorker failed to install: ServiceWorker failed to handle event (event.waitUntil Promise rejected)","sourceURL":""}
  Console: {"lineNumber":0,"message":"Uncaught (in promise) QuotaExceededError: Quota exceeded.","message_level":3,"sourceIdentifier":1,"sourceURL":"http://localhost:8100/service-worker.js"}
  </code></pre>
  
  <p>I know this is because low memory space on my OS installed drive. I have tried to handle it by following methods in script file but nothing worked.</p>
  
  <pre><code>self.addEventListener('error', function(e) {
    console.log(e.filename, e.lineno, e.colno, e.message);
  });
  
  
  self.onerror = function(message) {
    console.log(message);
  };
  </code></pre>
  
  <p>I just want to show user an error message like, "Please free some space from your OS installed directory to run the website". Where should write the code?</p>
  
  <p>Or</p>
  
  <p>I will bypass the service worker. Now it is showing me a blank white page.</p>
  
  <p>Bellow is my service worker registration code.</p>
  
  <pre><code>if ('serviceWorker' in navigator) {
    window.addEventListener('load', function() {
      navigator.serviceWorker.register('service-worker.js').then(function(registration) {
        // Registration was successful
        console.log('ServiceWorker registration successful with scope : ', registration.scope);
        registration.update();
      }, function(err) {
        // registration failed :(
        console.log('ServiceWorker registration failed: ', err);
      });
    });
  }
  </code></pre>