Skip to content

Commit 99bfe58

Browse files
committed
fix: unhandled rejection when getting the token
1 parent cd95534 commit 99bfe58

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/utils/token-manager.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ export namespace TokenManager {
7070
})()
7171

7272
// reset when finished, so that the next call will trigger a new check
73-
pendingGetToken.finally(() => {
74-
pendingGetToken = undefined
75-
})
73+
pendingGetToken
74+
.finally(() => {
75+
pendingGetToken = undefined
76+
})
77+
// we still need to catch the error here, otherwise it will be unhandled
78+
.catch(noop)
7679

7780
return pendingGetToken
7881
}

0 commit comments

Comments
 (0)