module.exports = class MintExceptionManagerError extends Error { constructor(name, message, stack) { super(message); if (name.startsWith("mint.lang")) { let type = name.substr(10); if ( type !== "CodeEvalException" && type !== "OutOfBoundsException" && type !== "VariableNotFoundException" && type !== "InternalSyntaxException" && type !== "IncompatibleTypesException" && type !== "URIFunctionsException" && type !== "CombinedFailuresException" && type !== "InternalKernelException" && type !== "InternalException" ) { this.name = "MintLangInternalException"; } } else if (name.startsWith("js.core.")) { let type = name.substr(8); switch (type) { case "EvalError": this.name = "MintLangCodeEvalException"; break; case "RangeError": this.name = "MintLangOutOfBoundsException"; break; case "ReferenceError": this.name = "MintLangVariableNotFoundException"; break; case "SyntaxError": this.name = "MintLangInternalSyntaxException"; break; case "TypeError": this.name = "MintLangIncompatibleTypesException"; break; case "URIError": this.name = "MintLangURIFunctionsException"; break; case "AggregateError": this.name = "MintLangCombinedFailuresException"; break; case "InternalError": this.name = "MintLangInternalKernelException"; break; default: this.name = "MintLangInternalException"; break; } } else { this.name = "MintLangInternalException"; } if (typeof stack !== "undefined") { this.stack = stack; } } }