Skip to content

Commit

Permalink
chore: add device session error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
vrockz747 committed Nov 8, 2024
1 parent 4309e40 commit a59ccda
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/core/src/operations/proto/getResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export const getResult = async ({
[ErrorType.INVALID_MSG]: DeviceAppErrorType.INVALID_MSG,
[ErrorType.APP_NOT_ACTIVE]: DeviceAppErrorType.APP_NOT_ACTIVE,
[ErrorType.APP_TIMEOUT_OCCURRED]: DeviceAppErrorType.APP_TIMEOUT,
[ErrorType.DEVICE_SESSION_INVALID]:
DeviceAppErrorType.DEVICE_SESSION_INVALID,
};

throw new DeviceAppError(errorMap[result.error.type]);
Expand Down
6 changes: 6 additions & 0 deletions packages/interfaces/src/errors/appError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export enum DeviceAppErrorType {

DEVICE_AUTH_FAILED = 'APP_0700',
CARD_AUTH_FAILED = 'APP_0701',

DEVICE_SESSION_INVALID = 'APP_0800',
}

type CodeToErrorMap = {
Expand Down Expand Up @@ -113,6 +115,10 @@ export const deviceAppErrorTypeDetails: CodeToErrorMap = {
subError: {},
message: 'Card seems to be compromised. Contact Cypherock support',
},
[DeviceAppErrorType.DEVICE_SESSION_INVALID]: {
subError: {},
message: 'Session establishment Failed. Invalid Session!',
},
};

export class DeviceAppError extends DeviceError {
Expand Down
2 changes: 1 addition & 1 deletion submodules/common
Submodule common updated 1 files
+2 −0 proto/core.proto

0 comments on commit a59ccda

Please sign in to comment.