diff --git a/packages/hms-video-store/src/error/utils.ts b/packages/hms-video-store/src/error/utils.ts index 370f1202fd..f1c70d113c 100644 --- a/packages/hms-video-store/src/error/utils.ts +++ b/packages/hms-video-store/src/error/utils.ts @@ -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; } diff --git a/packages/hms-video-store/src/reactive-store/adapter.ts b/packages/hms-video-store/src/reactive-store/adapter.ts index 8f2fa0ed0b..90d0217311 100644 --- a/packages/hms-video-store/src/reactive-store/adapter.ts +++ b/packages/hms-video-store/src/reactive-store/adapter.ts @@ -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, @@ -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 {