unierror.uts 846 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
import { SetUserCaptureScreenErrorCode, SetUserCaptureScreenFail } from "./interface.uts"
/**
 * 错误主题
 */
export const UniErrorSubject = 'uni-usercapturescreen';


/**
 * 错误信息
 * @UniError
 */
export const UniErrors : Map<SetUserCaptureScreenErrorCode, string> = new Map([
  /**
   * 错误码及对应的错误信息
   */
  [12001, 'setUserCaptureScreen:system not support'],
  [12010, 'setUserCaptureScreen:system internal error'],
]);


/**
 * 错误对象实现
 */
export class SetUserCaptureScreenFailImpl extends UniError implements SetUserCaptureScreenFail {

  /**
   * 错误对象构造函数
   */
  constructor(errCode : SetUserCaptureScreenErrorCode) {
    super();
    this.errSubject = UniErrorSubject;
    this.errCode = errCode;
    this.errMsg = UniErrors[errCode] ?? "";
  }
}