Skip to content

Commit 0e211be

Browse files
committed
fix(datasource/graphene) fixed fallback to legacy single-resolution mesh format when mesh info file is missing
1 parent 505eb24 commit 0e211be

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

src/datasource/graphene/frontend.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ import type { ValueOrError } from "#src/util/error.js";
172172
import { makeValueOrError, valueOrThrow } from "#src/util/error.js";
173173
import { EventActionMap } from "#src/util/event_action_map.js";
174174
import { mat4, vec3, vec4 } from "#src/util/geom.js";
175-
import { fetchOk, HttpError, isNotFoundError } from "#src/util/http_request.js";
175+
import { fetchOk, HttpError } from "#src/util/http_request.js";
176176
import {
177177
parseArray,
178178
parseFixedLengthArray,
@@ -451,21 +451,16 @@ async function getMeshMetadata(
451451
url: string,
452452
options: Partial<ProgressOptions>,
453453
): Promise<ParsedMeshMetadata> {
454-
let metadata: any;
455-
try {
456-
metadata = await getJsonMetadata(
457-
sharedKvStoreContext,
458-
url,
459-
/*required=*/ false,
460-
options,
461-
);
462-
} catch (e) {
463-
if (isNotFoundError(e)) {
464-
// If we fail to fetch the info file, assume it is the legacy
465-
// single-resolution mesh format.
466-
return { metadata: undefined };
467-
}
468-
throw e;
454+
const metadata = await getJsonMetadata(
455+
sharedKvStoreContext,
456+
url,
457+
/*required=*/ false,
458+
options,
459+
);
460+
if (metadata === undefined) {
461+
// If the info file is missing, assume it is the legacy
462+
// single-resolution mesh format.
463+
return { metadata: undefined };
469464
}
470465
return parseMeshMetadata(metadata);
471466
}

0 commit comments

Comments
 (0)