"use strict";var CoreErrorCode;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CoreErrorCode=void 0,function(r){r[r.UNKNOWN=-1]="UNKNOWN",r[r.CORE_MODULE_ERROR=1]="CORE_MODULE_ERROR",r[r.FILE_NOT_FOUND=2]="FILE_NOT_FOUND",r[r.REQUEST_ERROR=3]="REQUEST_ERROR",r[r.NETWORK_ERROR=4]="NETWORK_ERROR",r[r.PARAM_ERROR=5]="PARAM_ERROR",r[r.NO_PERMISSION=6]="NO_PERMISSION",r[r.TIMEOUT=7]="TIMEOUT",r[r.NOT_LOGIN=8]="NOT_LOGIN",r[r.COMPILE_PATH_ERROR=9]="COMPILE_PATH_ERROR",r[r.ENTRY_ERROR=10]="ENTRY_ERROR",r[r.COMPILE_ERROR=11]="COMPILE_ERROR",r[r.UNPACK_FAIL=12]="UNPACK_FAIL",r[r.CREATED_FAIL=13]="CREATED_FAIL",r[r.LAUNCH_FAIL=14]="LAUNCH_FAIL",r[r.SESSION_EXPIRED=15]="SESSION_EXPIRED"}(CoreErrorCode=exports.CoreErrorCode||(exports.CoreErrorCode={}));class CoreError extends Error{constructor(r){r instanceof Error?(super(r.message),this.stack=r.stack,this.code=CoreErrorCode.UNKNOWN):"object"==typeof r&&r?(super(r.message),this.code=r.code||CoreErrorCode.UNKNOWN,r.advise&&(this.advise=r.advise)):(super(r),this.code=CoreErrorCode.UNKNOWN),this.name=this.code?CoreErrorCode[this.code]:"CoreError"}toJSON(){return`${CoreErrorCode[this.code]} ${this.message} ${this.stack}`}toString(){return this.message}static isCoreError(r){return r instanceof CoreError}}exports.default=CoreError;