title: How to get status code when using EventSource in chrome?
body: <p>I have tried to use the native EventSource in Google Chrome, If the server response with an error, details about this response will be shown at response header in chrome inspect</p>
  
  <p><a href="https://i.stack.imgur.com/O6iXJ.png" rel="nofollow noreferrer">error details</a> </p>
  
  <p>but it seems to be impossible to get response status code from <code>error</code> parameter neither in callback function <code>onerror</code> nor listener handler (<code>source.addEventListener('error',function (error){})</code>). </p>
  
  <pre><code>    let source = new EventSource('http://127.0.0.1:7071/sse?access_token=xxxxxxx')
      source.onerror = function (error) {
          console.log(error)
      };
  
      source.onmessage = function (event) {
          console.log('Unknown event with message :' + event.data)
      };
  
      source.addEventListener('log',function (event) {
          console.log('log event with message :' + event.data)
      });
  
      source.addEventListener('error',function (error) {
          console.log(error)
  
      })
  </code></pre>
  
  <p>So, is there another way to get the response details in code? 
  Any help will be greatly appreciated.</p>