Skip to content

Commit

Permalink
fix: reactive store comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hdz-666 committed Oct 30, 2024
1 parent f3ba7db commit 7f1e659
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
3 changes: 0 additions & 3 deletions packages/hms-video-store/src/error/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ function getDefaultError(error: string, deviceInfo: string) {
} else if (message.includes('permission denied')) {
exception = ErrorFactory.TracksErrors.CantAccessCaptureDevice(HMSAction.TRACK, deviceInfo, error);
}
if (deviceInfo) {
exception.addDeviceType(deviceInfo);
}

return exception;
}
Expand Down
21 changes: 6 additions & 15 deletions packages/hms-video-store/src/reactive-store/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,7 @@ export class SDKToHMS {
}

static convertException(sdkException: sdkTypes.HMSException): HMSException {
if (sdkException.deviceType) {
return {
code: sdkException.code,
action: sdkException.action,
name: sdkException.name,
message: sdkException.message,
description: sdkException.description,
isTerminal: sdkException.isTerminal,
nativeError: sdkException.nativeError,
deviceType: sdkException.deviceType,
timestamp: new Date(),
};
}
return {
const exp = {
code: sdkException.code,
action: sdkException.action,
name: sdkException.name,
Expand All @@ -226,7 +213,11 @@ export class SDKToHMS {
isTerminal: sdkException.isTerminal,
nativeError: sdkException.nativeError,
timestamp: new Date(),
};
} as HMSException;
if (sdkException.deviceType) {
exp.deviceType = sdkException.deviceType;
}
return exp;
}

static convertDeviceChangeUpdate(sdkDeviceChangeEvent: sdkTypes.HMSDeviceChangeEvent): HMSDeviceChangeEvent {
Expand Down

0 comments on commit 7f1e659

Please sign in to comment.