Skip to content

Commit

Permalink
Remove exception swallowing
Browse files Browse the repository at this point in the history
This seems like it causes more problems than it solves.
  • Loading branch information
richvdh committed May 24, 2023
1 parent 7cbfd48 commit a09ba14
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/utils/device/isDeviceVerified.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean | null> => {
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;
};

0 comments on commit a09ba14

Please sign in to comment.