Skip to content

Commit

Permalink
fix(zero-cache): use new "Rehome" error kind when CVR ownership chang…
Browse files Browse the repository at this point in the history
…es (#3716)
  • Loading branch information
darkgnotic authored Feb 5, 2025
1 parent 9dad349 commit 7d14247
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/zero-cache/src/services/view-syncer/cvr-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,14 +1106,18 @@ export class ConcurrentModificationException extends ErrorWithLevel {
}
}

export class OwnershipError extends ErrorWithLevel {
export class OwnershipError extends ErrorForClient {
readonly name = 'OwnershipError';

constructor(owner: string | null, grantedAt: number | null) {
super(
`CVR ownership was transferred to ${owner} at ${new Date(
grantedAt ?? 0,
).toISOString()}`,
{
kind: ErrorKind.Rehome,
message:
`CVR ownership was transferred to ${owner} at ` +
`${new Date(grantedAt ?? 0).toISOString()}`,
maxBackoffMs: 0,
},
'info',
);
}
Expand Down

0 comments on commit 7d14247

Please sign in to comment.