1. 3
  1.  

  2. 1

    You should always surround Promise.all() with a try/catch or a .catch().

    I don’t think that everyone would agree ;) Propagating the error up the stack might be the right choice, actually quite often.

    1. 1

      One note on this:

      An important note is that Promise.allSettled can never throw. You do not need to wrap it with try/catch - it will always resolve.

      Promise.allSettled can throw if you pass a non-iterable object as an argument, for example:

      Promise.allSettled({})
        .catch(err => {
         // err = TypeError: Argument of Promise.allSettled is not iterable
        });
      

      (Granted, this is more of a technicality)