Extract reset error
This commit is contained in:
parent
8a27987798
commit
a937f64fa0
2 changed files with 8 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import type { Settings } from "../persistence/settings";
|
||||
import type { Logger } from "../tracing/logger";
|
||||
import { createPromise } from "../utils/create-promise";
|
||||
import { sleep } from "../utils/sleep";
|
||||
import { SyncResetError } from "./sync-reset-error";
|
||||
|
||||
export class ConnectionStatus {
|
||||
private static readonly UNTIL_RESOLUTION = Symbol();
|
||||
|
|
@ -40,7 +40,7 @@ export class ConnectionStatus {
|
|||
}
|
||||
|
||||
public reset(): void {
|
||||
this.rejectUntil(new Error("Sync was reset"));
|
||||
this.rejectUntil(new SyncResetError());
|
||||
[this.until, this.resolveUntil, this.rejectUntil] = createPromise();
|
||||
}
|
||||
|
||||
|
|
|
|||
6
frontend/sync-client/src/services/sync-reset-error.ts
Normal file
6
frontend/sync-client/src/services/sync-reset-error.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export class SyncResetError extends Error {
|
||||
constructor() {
|
||||
super("Sync was reset");
|
||||
this.name = "SyncResetError";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue