Skip to content

Commit dd47b57

Browse files
committed
Update useConnection.ts
1 parent b4ae132 commit dd47b57

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/src/lib/hooks/useConnection.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,12 @@ export function useConnection({
225225
if (shouldRetry) {
226226
return connect(undefined, retryCount + 1);
227227
}
228-
return;
228+
229+
if (error instanceof SseError && error.code === 401) {
230+
// Don't set error state if we're about to redirect for auth
231+
return;
232+
}
233+
throw error;
229234
}
230235

231236
const capabilities = client.getServerCapabilities();

0 commit comments

Comments
 (0)