Skip to content

Commit

Permalink
extracts readableErrorCode to userInfo (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro committed Jul 21, 2021
1 parent 9a3e5c1 commit e3945fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions dist/errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export interface PurchasesError {
code: PURCHASES_ERROR_CODE;
message: string;
readableErrorCode: string;
userInfo: ErrorInfo;
underlyingErrorMessage: string;
userCancelled: boolean | null;
}
export interface ErrorInfo {
readableErrorCode: string;
}
13 changes: 10 additions & 3 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ export enum PURCHASES_ERROR_CODE {
export interface PurchasesError {
code: PURCHASES_ERROR_CODE;
message: string;
// @deprecated
// access readableErrorCode through userInfo.readableErrorCode
readableErrorCode: string;
userInfo: ErrorInfo;
underlyingErrorMessage: string;

// @deprecated
// use code === Purchases.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR instead
userCancelled: boolean | null;
// @deprecated
// use code === Purchases.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR instead
userCancelled: boolean | null;
}

export interface ErrorInfo {
readableErrorCode: string;
}

0 comments on commit e3945fb

Please sign in to comment.