Skip to content

Commit

Permalink
tweaks to typeguard and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
daveajrussell committed Oct 24, 2024
1 parent 5c1129d commit 65c0906
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/shared/services/bolt/globalDrivers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ export const buildGlobalDriversObject = async (
routed && (await routed.verifyConnectivity())
routingSupported = true
} catch (e) {
if (e && isBrowserError(e) && isNonSupportedRoutingSchemeError(e)) {
routingSupported = false
}

if (isError(e)) {
if (e && isError(e)) {
if (isBrowserError(e) && isNonSupportedRoutingSchemeError(e)) {
routingSupported = false
}
failFn(e)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/typeguards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export function isError(error: unknown): error is Error {
}

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

0 comments on commit 65c0906

Please sign in to comment.