"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.isCompileError=exports.CompileError=void 0;const i18n_1=__importDefault(require("../i18n")),api_1=require("../config/api"),Error_1=require("./Error");class CompileError extends Error{constructor(e,r,o,i){super(`${i18n_1.default.t("COMPILE_ERROR")}:\n${e.replace(/^compile fail, reason is {2}/,"")}`),this.type=Error_1.CoreErrorCode.COMPILE_ERROR,this.code=r,this.logId=o,this.normalize(i)}normalize(e){if(-1!==this.message.indexOf(" is not found which referenced by")&&(this.message=this.message.replace(/\/opt\/tiger\/compiler_dir\/cli_[0-9a-zA-Z_]{20,}\/sourcecode/g,"{your_project_root}"),e)){const r=(0,api_1.getDomain)(e);this.advise=`https://open.${r||"feishu.cn"}/document/uYjL24iN/ugDM0YjL4ADN24COwQjN#8f8cbb94`}}IPCFormat(){return{type:this.type,message:this.message,code:this.code,logId:this.logId,stack:this.stack,advise:this.advise}}}function isCompileError(e){return e instanceof CompileError}exports.CompileError=CompileError,exports.isCompileError=isCompileError;