Skip to content

Commit 1df55f9

Browse files
authored
chore(shell-api): check StaleConfig error codeName in addition to code number (#1554)
The server team has confirmed that they prefer for downstream teams to check error codeName values rather than (only) code numbers, as the latter may go away when code is being refactored.
1 parent 3df98c7 commit 1df55f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/shell-api/src/collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ export default class Collection extends ShellApiWithMongoClass {
18531853

18541854
return await this._aggregateAndScaleCollStats(collStats, scale);
18551855
} catch (e: any) {
1856-
if (e?.code === 13388) {
1856+
if (e?.codeName === 'StaleConfig' || e?.code === 13388) {
18571857
// Fallback to the deprecated way of fetching that folks can still
18581858
// fetch the stats of sharded timeseries collections. SERVER-72686
18591859
try {

0 commit comments

Comments
 (0)