import { ExitErrorCode, IExitError } from "./interface.uts" /** * 错误主题 */ export const ExitUniErrorSubject = 'uni-exit'; /** * 错误码 * @UniError */ export const ExitUniErrors:Map = new Map([ /** * 系统不支持 */ [12001, 'system not support'], /** * 未知错误 */ [12002, 'unknown error'] ]); /** * ExitFail的实现 */ export class ExitFailImpl extends UniError implements IExitError { // #ifdef APP-ANDROID override errCode: ExitErrorCode // #endif constructor ( errCode: ExitErrorCode ) { super() this.errSubject = ExitUniErrorSubject this.errCode = errCode this.errMsg = ExitUniErrors[errCode] ?? '' } }