@creejs/commons-lang 2.1.21 → 2.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1849,12 +1849,12 @@ function any (tasks) {
1849
1849
  errors.push(e);
1850
1850
  // all tasks failed
1851
1851
  if (errors.length >= tasks.length) {
1852
- deferred.reject(errors);
1852
+ deferred.reject(new AggregatedError('All Tasks Failed', errors));
1853
1853
  }
1854
1854
  });
1855
1855
  }
1856
1856
  if (errors.length === tasks.length) {
1857
- deferred.reject(errors);
1857
+ deferred.reject(new AggregatedError('All Tasks Failed', errors));
1858
1858
  }
1859
1859
  return deferred.promise
1860
1860
  }
@@ -2047,7 +2047,7 @@ async function parallelAny (tasks, maxParallel = 5) {
2047
2047
  // No task left, and No successful execution, reject with errors
2048
2048
  if (errors.length >= tasks.length) {
2049
2049
  if (deferred.pending) {
2050
- deferred.reject(errors);
2050
+ deferred.reject(new AggregatedError('All Tasks Failed', errors));
2051
2051
  return
2052
2052
  }
2053
2053
  }