Skip to content

Commit 2f6153c

Browse files
throw instead of returning
1 parent bd133d0 commit 2f6153c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/common/src/client/sync/stream/AbstractRemote.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ export abstract class AbstractRemote {
502502
* Aborting the active fetch request while it is being consumed seems to throw
503503
* an unhandled exception on the window level.
504504
*/
505+
if (abortSignal?.aborted) {
506+
throw new AbortOperation('Abort request received before making postStreamRaw request');
507+
}
508+
505509
const controller = new AbortController();
506510
let requestResolved = false;
507511
abortSignal?.addEventListener('abort', () => {

packages/common/src/client/sync/stream/AbstractStreamingSyncImplementation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ The next upload iteration will be delayed.`);
900900
let hadSyncLine = false;
901901

902902
if (signal.aborted) {
903-
return;
903+
throw new AbortOperation('Connection request has been aborted');
904904
}
905905
const abortController = new AbortController();
906906
signal.addEventListener('abort', () => abortController.abort());

0 commit comments

Comments
 (0)