summaryrefslogtreecommitdiff
path: root/node_modules/@11ty/eleventy/src/Errors/EleventyBaseError.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@11ty/eleventy/src/Errors/EleventyBaseError.js')
-rw-r--r--node_modules/@11ty/eleventy/src/Errors/EleventyBaseError.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/@11ty/eleventy/src/Errors/EleventyBaseError.js b/node_modules/@11ty/eleventy/src/Errors/EleventyBaseError.js
new file mode 100644
index 0000000..6e76c5f
--- /dev/null
+++ b/node_modules/@11ty/eleventy/src/Errors/EleventyBaseError.js
@@ -0,0 +1,24 @@
+/**
+ * This class serves as basis for all Eleventy-specific errors.
+ * @ignore
+ */
+class EleventyBaseError extends Error {
+ /**
+ * @param {string} message - The error message to display.
+ * @param {unknown} [originalError] - The original error caught.
+ */
+ constructor(message, originalError) {
+ super(message);
+
+ this.name = this.constructor.name;
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ if (originalError) {
+ this.originalError = originalError;
+ }
+ }
+}
+export default EleventyBaseError;