unierror.uts 813 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { SetUserCaptureScreenErrorCode, SetUserCaptureScreenFail } from "./interface.uts"
  2. /**
  3. * 错误主题
  4. */
  5. export const UniErrorSubject = 'uni-usercapturescreen';
  6. /**
  7. * 错误信息
  8. * @UniError
  9. */
  10. export const UniErrors : Map<SetUserCaptureScreenErrorCode, string> = new Map([
  11. /**
  12. * 错误码及对应的错误信息
  13. */
  14. [12001, 'setUserCaptureScreen:system not support'],
  15. [12010, 'setUserCaptureScreen:system internal error'],
  16. ]);
  17. /**
  18. * 错误对象实现
  19. */
  20. export class SetUserCaptureScreenFailImpl extends UniError implements SetUserCaptureScreenFail {
  21. /**
  22. * 错误对象构造函数
  23. */
  24. constructor(errCode : SetUserCaptureScreenErrorCode) {
  25. super();
  26. this.errSubject = UniErrorSubject;
  27. this.errCode = errCode;
  28. this.errMsg = UniErrors[errCode] ?? "";
  29. }
  30. }