Extract reset error

This commit is contained in:
Andras Schmelczer 2025-03-22 17:07:04 +00:00
parent 8a27987798
commit a937f64fa0
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 8 additions and 2 deletions

View file

@ -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();
}

View file

@ -0,0 +1,6 @@
export class SyncResetError extends Error {
constructor() {
super("Sync was reset");
this.name = "SyncResetError";
}
}