summaryrefslogtreecommitdiffstats
path: root/node_modules/npm-run-all/lib/npm-run-all-error.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/npm-run-all/lib/npm-run-all-error.js
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/npm-run-all/lib/npm-run-all-error.js')
-rw-r--r--node_modules/npm-run-all/lib/npm-run-all-error.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/node_modules/npm-run-all/lib/npm-run-all-error.js b/node_modules/npm-run-all/lib/npm-run-all-error.js
new file mode 100644
index 0000000..af08b09
--- /dev/null
+++ b/node_modules/npm-run-all/lib/npm-run-all-error.js
@@ -0,0 +1,47 @@
+/**
+ * @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
+ }
+}