unierror.uts 664 字节
Newer Older
VK1688's avatar
VK1688 已提交
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
import { OpenLocationErrorCode, OpenLocationFail } from "./interface.uts"

/**
 * 错误主题
 */

export const UniErrorSubject = 'uni-openLocation';

/**
 * 错误码
 * @UniError
 */
export const UniErrors : Map<OpenLocationErrorCode, string> = new Map([
  /**
   * 框架内部错误
   */
  [4, 'internal error']
]);

export class OpenLocationFailImpl extends UniError implements OpenLocationFail {
  // #ifndef APP-IOS
  override errCode : OpenLocationErrorCode;
  // #endif
  constructor(errCode : OpenLocationErrorCode) {
    super();
    this.errSubject = UniErrorSubject;
    this.errCode = errCode;
    this.errMsg = UniErrors.get(errCode) ?? "";
  }
}