Skip to content

Commit 65c0906

Browse files
committed
tweaks to typeguard and usage
1 parent 5c1129d commit 65c0906

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/shared/services/bolt/globalDrivers.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ export const buildGlobalDriversObject = async (
6565
routed && (await routed.verifyConnectivity())
6666
routingSupported = true
6767
} catch (e) {
68-
if (e && isBrowserError(e) && isNonSupportedRoutingSchemeError(e)) {
69-
routingSupported = false
70-
}
71-
72-
if (isError(e)) {
68+
if (e && isError(e)) {
69+
if (isBrowserError(e) && isNonSupportedRoutingSchemeError(e)) {
70+
routingSupported = false
71+
}
7372
failFn(e)
7473
}
7574
}

src/shared/utils/typeguards.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export function isError(error: unknown): error is Error {
55
}
66

77
export function isBrowserError(error: unknown): error is BrowserError {
8-
return error instanceof Error && 'code' in error && 'message' in error
8+
return error instanceof Error && 'code' in error
99
}

0 commit comments

Comments
 (0)