Urara-Blog/node_modules/.pnpm-store/v3/files/bc/1ff63234b7fac0fe362cc90a19e003c6baf669b55a63832bb483e180b9e13819f588451d187dfb9abfe5f31f66b2f19ef88490f1f19d1964fc4d9a48435c7d
2022-08-14 01:14:53 +08:00

47 lines
1.4 KiB
Text

/**
* @module npm-run-all-error
* @author Toru Nagashima
* @copyright 2016 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
"use strict"
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Error object with some additional info.
*/
module.exports = class NpmRunAllError extends Error {
/**
* Constructor.
*
* @param {{name: string, code: number}} causeResult -
* The result item of the npm-script which causes an error.
* @param {Array.<{name: string, code: (number|undefined)}>} allResults -
* All result items of npm-scripts.
*/
constructor(causeResult, allResults) {
super(`"${causeResult.task}" exited with ${causeResult.code}.`)
/**
* The name of a npm-script which exited with a non-zero code.
* @type {string}
*/
this.name = causeResult.name
/**
* The code of a npm-script which exited with a non-zero code.
* This can be `undefined`.
* @type {number}
*/
this.code = causeResult.code
/**
* All result items of npm-scripts.
* @type {Array.<{name: string, code: (number|undefined)}>}
*/
this.results = allResults
}
}