unierror.uts 664 B

123456789101112131415161718192021222324252627282930
  1. import { OpenLocationErrorCode, OpenLocationFail } from "./interface.uts"
  2. /**
  3. * 错误主题
  4. */
  5. export const UniErrorSubject = 'uni-openLocation';
  6. /**
  7. * 错误码
  8. * @UniError
  9. */
  10. export const UniErrors : Map<OpenLocationErrorCode, string> = new Map([
  11. /**
  12. * 框架内部错误
  13. */
  14. [4, 'internal error']
  15. ]);
  16. export class OpenLocationFailImpl extends UniError implements OpenLocationFail {
  17. // #ifndef APP-IOS
  18. override errCode : OpenLocationErrorCode;
  19. // #endif
  20. constructor(errCode : OpenLocationErrorCode) {
  21. super();
  22. this.errSubject = UniErrorSubject;
  23. this.errCode = errCode;
  24. this.errMsg = UniErrors.get(errCode) ?? "";
  25. }
  26. }