"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.isRequestError=exports.RequestError=void 0;const i18n_1=__importDefault(require("../i18n")),Error_1=require("./Error");var ResponseCode;!function(e){e[e.NOT_LOGIN=51]="NOT_LOGIN"}(ResponseCode||(ResponseCode={}));const codeMap={51:{message:"Err_Permission_App_Info",advise:"Err_Permission_App_Info_Advise"}};class RequestError extends Error{constructor(e,s,r,o){var t,i;super(e),this.type=Error_1.CoreErrorCode.REQUEST_ERROR,this.code=s,(null===(t=codeMap[this.code])||void 0===t?void 0:t.message)&&(this.message=i18n_1.default.t(codeMap[this.code].message)),(null===(i=codeMap[this.code])||void 0===i?void 0:i.advise)?this.advise=i18n_1.default.t(codeMap[this.code].advise):this.advise=o,this.logId=r}IPCFormat(){var e;return{type:this.type,message:this.message,code:this.code,logId:this.logId,advise:null!==(e=this.advise)&&void 0!==e?e:"",stack:this.stack}}}function isRequestError(e){return e instanceof RequestError}exports.RequestError=RequestError,exports.isRequestError=isRequestError;