title: problems with map with Promise.All returns error before my promise done
body: <p>I hope you have a great day.</p>
  <p>Ok so, I'm doing an API with <strong>Express</strong> in <strong>Javascript</strong>. So one function contains a Stored Procedure from <strong>MySQl</strong>.</p>
  <p>When I running this function all execute correctly but returns error. <strong>Later returns error still my console is running</strong>, so i think i did something wrong.</p>
  <p>My function is this. This data i need it for create a csv file</p>
  <pre><code>const getActivitiesForUser = async (user, index) =&gt; {
    try {
      let exeData = {};
  
  
      exeData.name = promedios[0][index].nombre;
      await sequelize.query(`call getActivitiesForUser(${user.dataValues.userId}, '${editionName}' )`)
      await sequelize.query('SELECT * FROM temp_AlumnoActivitiesSchedule')
        .then((result) =&gt; {
  
          let tempActividades = actividades[0];
          result[0].map((item) =&gt; {
  
            //Existe este item en actividades ? 
            for (let index = 0; index &lt; tempActividades.length; index++) {
              // console.log( tempActividades[index].actividad );
              // console.log( item.actividad );
              if (item.actividad === tempActividades[index].actividad) {
                exeData[`${item.actividad}`] = item.calificacion;
                tempActividades = tempActividades.filter(itemRem =&gt; itemRem.actividad !== item.actividad)
                break;
              }
              else {
                exeData[`${item.actividad}`] = 0;
              }
  
            }
            worksheet2.push(exeData);
          })
        }).catch(e =&gt; {
          console.log(e);
        })
    } catch (e) {
      console.log(e)
    }
  }
  </code></pre>
  <p>Well, I need get some activities for a lot users
  I did it, here</p>
  <pre><code>   let promises = [];
  studentGroup.map((user, index) =&gt; {
    promises.push(getActivitiesForUser(user, index));
  });
  
  Promise.all(promises)
    .then((result) =&gt; {
      let set = new Set(worksheet2.map(JSON.stringify))
      let arrSinDuplicaciones = Array.from(set).map(JSON.parse);
  
      console.log(arrSinDuplicaciones);
    }).catch((err) =&gt; {
      console.log(err)
    })
  
  const csv = json2csvParse2.parse(arrSinDuplicaciones);
  </code></pre>
  <p>maybe some variables doesnt exist in this code, I want to see if I wrong in the how i did the Promise.All.</p>