Skip to content

Commit 14f29b8

Browse files
Fix assert in VersionedSummarizer (#26034)
## Description Fix invalid assert. This used to error with: > $ pnpm run policy-check:asserts > ... > ERROR: Template expressions are not supported in assertions (they'll be replaced by a short code anyway). Use a string literal instead. > .../packages/dds/tree/src/shared-tree-core/versionedSummarizer.ts:47 This uses the newish debug message provider to preserve the more detailed message for debug builds while allowing the production one to be tagged.
1 parent 1c07ca1 commit 14f29b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/dds/tree/src/shared-tree-core/versionedSummarizer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export abstract class VersionedSummarizer<TVersion extends number> implements Su
4444
) {
4545
assert(
4646
this.supportedVersions.has(this.writeVersion),
47-
`Write version ${this.writeVersion} must be supported.`,
47+
"Unsupported write version requested.",
48+
() => `Write version ${this.writeVersion} requested but not supported with key ${key}.`,
4849
);
4950
}
5051

0 commit comments

Comments
 (0)