title: Javascript error handling catches nothing
body: <p>I have strange error generation function.. It is from HttpRequest like this</p>
  
  <pre><code>public async request(method, url, data, headers = {}){
      let init { method: method };
      if (data) {
          let payload: string = JSON.stringify(data);
          init.body = payload;
      }
  
      if (this.key) headers["x-auth-token"] = this.key;
      headers["Content-Type"] = "application/json";
      init.headers = headers;
  
      let result = await fetch(url, init);
      if (result.status == 200) return result;
      throw { status: result.status, message: result.statusText };
  }
  </code></pre>
  
  <p>Now, I am trying to catch with something like this:</p>
  
  <pre><code>try {
      let img = await HttpRequest.request("GET", "/login");
      let text = await img.text();
  
      let str = "data:image/jpeg;base64, " + text;
      this.setState({ avatar: str });
  } catch (err) {
      console.log("log here");
  }
  </code></pre>
  
  <p>What is strange, was that nothing catched, even though I deliberately made an error, no "log here" shows anywhere in console.</p>
  
  <p>But if I change it like this:</p>
  
  <pre><code>try {
      let img = await HttpRequest.request("GET", "/login");
      let text = await img.text();
  
      let str = "data:image/jpeg;base64, " + text;
      this.setState({ avatar: str });
  } catch (err) {
      console.error("log here"); // &lt;--- console.error() instead of console.log
  }
  </code></pre>
  
  <p>Then the console showed "log here" error. It is strange that difference between console.log and console.error inside same catch clause treated different way.</p>
  
  <p>Can anyone help me here, where did I do wrong?</p>
  
  <p>Thank you</p>
  
  <p>EDIT: If it made difference, the code behaved correctly before, when I throw the error as <code>throw "ERROR " + result.status + ": " + result.statusText;</code> at my <code>request()</code> function. It was back to normal when I changed it back to throw string instead of object.</p>