title: How to skip a promise that doesn't work?
body: <pre><code>async function getData() {
    const getProject = await axios.get('url', {
      auth: {
        username: 'username',
        password: 'pw'
      }
    });
  
    const projects = getProject.data.value;
    const promises = projects.map(project =&gt;
      axios.get(`url`, {
        auth: {
          username: 'username',
          password: 'pw'
        }
      })
    );
  
    const results = await axios.all(promises)
  
    const KPIs = results.map(v =&gt; v.data.value);
  }
  </code></pre>
  
  <p>What I am trying to do is:</p>
  
  <ol>
  <li><p>get an axios call to fetch the name of the projects.</p></li>
  <li><p>Use those fetched names to call multiple axios calls. This is supposed to give me some data from that project.</p></li>
  </ol>
  
  <p>When I do the second axios call, there are some API calls that won't work because the data does not exist in that project. This was intended. But it will break by giving me the 404 error and won't reach the line <code>const results = await axios.all(promises)</code>. </p>
  
  <p>I want it to skip that whenever it doesn't exist and only call it from the one that exists and store the fetched data into <code>KPIs</code>. How can I do that?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The first axios call returns an array of objects</p>
  
  <p>ex) 
  <code>{id: "id...", name: "Javelin", url: " .visualstudio.com/_apis/projects/6a93eab2-4996-4d02-8a14-767f02d94993", state: "wellFormed", revision: 99, …}</code></p>
  
  <p>Something like that. So, I literally just get the <code>.name</code> of this object and put it into my url like:</p>
  
  <p><code>axios.get({id}.extmgmt.visualstudio.com/_apis/ExtensionManagement/InstalledExtensions/{id}/..../${project.name}_test/Documents</code></p>