title: Unable to handle 404 error in axios with try and catch
body: <p>I have been trying to build a weather app, but I have some trouble with verifying the http status in case a user inserts willingly a city name that doesn't exist or in case the user makes a typo inside the input field.</p>
  <p>The only problem is that I can't find a way to insert the status !== 200 in the axios promise.</p>
  <p>The 200 status works pretty fine, but the 404 doesn't. I am sure there is an error somewhere in the promise, but I can't manage to find the way out of it.</p>
  <p>Moreover when I console log the error, it shows this message:</p>
  <p>error in the console.log</p>
  <pre><code>Uncaught (in promise) Error: Request failed with status code 404
      at e.exports (createError.js:16)
      at e.exports (settle.js:17)
      at XMLHttpRequest.E (xhr.js:66)
  </code></pre>
  <p>Javascript</p>
  <pre><code>try{            
              axios.get(`https://api.openweathermap.org/data/2.5/weather?q=${city}&amp;appid=${api_key}`).then(
                  
              async response =&gt; {
                  
              let data = await response.data
  
              if (response.status !== 200) {
              
                  throw new Error(response.status);
              
                  } else {
              
              console.log(data)
              document.getElementById('hum').textContent = data.main.humidity;
              document.getElementById('feels-like').textContent = data.main.feels_like;
                  }}
          )
          
          } catch(error) {
              if (response.status === 404) {
                  console.log(`Err: ${error}`);
                  throw err;
              }
                     
          
          };
  
  </code></pre>
  <p>Any suggestions is really appreciated. Thank you!</p>