How to use the verror.errorFromList function in verror

To help you get started, we’ve selected a few verror examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IcedFrisby / IcedFrisby / lib / icedfrisby.js View on Github external
} catch (e) {
        didFail = true
      }
    }

    // Run the `finally()` hooks, regardless of sucess or failure.
    try {
      await this._runHooks(this._hooks.finally)
    } catch (e) {
      didFail = true
    }

    if (didFail) {
      // Return null, the sole error, or a MultiError.
      // https://github.com/joyent/node-verror#verrorerrorfromlisterrors
      throw errorFromList(this._failures)
    }
  }
github bahamas10 / hueadm / lib / common.js View on Github external
return;

                if (!res.hasOwnProperty('error'))
                    return;

                var error = new Error(res.error.description);
                error.type = res.error.type;
                error.address = res.error.address;

                errors.push(error);
            });
        }

        console.log(s);

        cb(verror.errorFromList(errors));
    }
github joyent / node-vasync / lib / vasync.js View on Github external
q.once('end', function queueDrained() {
		if (errors.length > 0) {
			callback(mod_verror.errorFromList(errors));
			return;
		}

		/*
		 * results is now an array of objects in the same order of the
		 * inputs array, where each object looks like:
		 *
		 * {
		 *     "ans": ,
		 *     "elem": 
		 * }
		 *
		 * we filter out elements that have a false "ans" value, and
		 * then map the array to contain only the input elements.
		 */
		results = results.filter(function filterFalseInputs(input) {