From a09ba1459b64afb63758364347c418e03a283c65 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 24 May 2023 15:31:10 +0100 Subject: [PATCH] Remove exception swallowing This seems like it causes more problems than it solves. --- src/utils/device/isDeviceVerified.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/utils/device/isDeviceVerified.ts b/src/utils/device/isDeviceVerified.ts index 3aabf264db14..a139069fe273 100644 --- a/src/utils/device/isDeviceVerified.ts +++ b/src/utils/device/isDeviceVerified.ts @@ -26,15 +26,10 @@ import { MatrixClient } from "matrix-js-sdk/src/matrix"; * indicating whether the device has been cross-signed by a cross-signing key we trust. */ export const isDeviceVerified = async (client: MatrixClient, deviceId: string): Promise => { - try { - const trustLevel = await client.getCrypto()?.getDeviceVerificationStatus(client.getSafeUserId(), deviceId); - if (!trustLevel) { - // either no crypto, or an unknown/no-e2e device - return null; - } - return trustLevel.crossSigningVerified; - } catch (e) { - console.error("Error getting device cross-signing info", e); + const trustLevel = await client.getCrypto()?.getDeviceVerificationStatus(client.getSafeUserId(), deviceId); + if (!trustLevel) { + // either no crypto, or an unknown/no-e2e device return null; } + return trustLevel.crossSigningVerified; };