Initial import

This commit is contained in:
2025-11-05 20:35:04 +01:00
commit 5b1fd847c2
4586 changed files with 685044 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
'use strict'
module.exports = class ModuleError extends Error {
/**
* @param {string} message Error message
* @param {{ code?: string, cause?: Error, expected?: boolean, transient?: boolean }} [options]
*/
constructor (message, options) {
super(message || '')
if (typeof options === 'object' && options !== null) {
if (options.code) this.code = String(options.code)
if (options.expected) this.expected = true
if (options.transient) this.transient = true
if (options.cause) this.cause = options.cause
}
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor)
}
}
}