@creejs/commons-lang 2.1.14 → 2.1.15

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.
@@ -1381,7 +1381,7 @@ function substringsBetween (str, startMarker, endMarker) {
1381
1381
  * 1. Executes a task silently, suppressing any errors or rejections.
1382
1382
  * 2. if loggerLike is provided, will log the error via it
1383
1383
  * @param {Function} task - The export function to execute.
1384
- * @param {LoggerLike} loggerLike - The logger-like object to use for logging.
1384
+ * @param {LoggerLike} [loggerLike] - The logger-like object to use for logging.
1385
1385
  * @returns {Promise<*>|*} The return value of the task, or a Promise if the task is asynchronous.
1386
1386
  */
1387
1387
  function quiet (task, loggerLike) {
@@ -1389,13 +1389,13 @@ function quiet (task, loggerLike) {
1389
1389
  try {
1390
1390
  const rtnVal = task();
1391
1391
  if (isPromise(rtnVal)) {
1392
- return rtnVal.catch(() => {
1393
- // do nothing
1392
+ return rtnVal.catch((/** @type {any} */ err) => {
1393
+ loggerLike && loggerLike.isErrorEnabled() && loggerLike.error('quiet() with async error:', err);
1394
1394
  })
1395
1395
  }
1396
1396
  return rtnVal
1397
- } catch (e) {
1398
- // do nothing
1397
+ } catch (err) {
1398
+ loggerLike && loggerLike.isErrorEnabled() && loggerLike.error('quiet() with sync error:', err);
1399
1399
  }
1400
1400
  }
1401
1401