Spaces:
Running
Running
viewer: log GLB load errors + surface a friendly message instead of silently empty stage
Browse files- index.html +6 -1
index.html
CHANGED
|
@@ -570,7 +570,12 @@ async function loadItem(cls, item) {
|
|
| 570 |
if (_sl) { _slt.textContent = `loading ${item.id}…`; _sl.classList.add("active"); }
|
| 571 |
let gltf;
|
| 572 |
try { gltf = await loader.loadAsync(dsUrl(cls.dataset, item.glb)); }
|
| 573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 574 |
if (gen !== loadGen) return; // user already switched away — drop this load
|
| 575 |
model = new THREE.Group();
|
| 576 |
// Shipped GLBs are Y-up (Blender glTF export); catalog pivots/axes are also
|
|
|
|
| 570 |
if (_sl) { _slt.textContent = `loading ${item.id}…`; _sl.classList.add("active"); }
|
| 571 |
let gltf;
|
| 572 |
try { gltf = await loader.loadAsync(dsUrl(cls.dataset, item.glb)); }
|
| 573 |
+
catch (err) {
|
| 574 |
+
console.error(`GLB load failed for ${item.id}:`, err);
|
| 575 |
+
if (_sl) { _slt.textContent = `couldn\u2019t load ${item.id}`; }
|
| 576 |
+
return;
|
| 577 |
+
}
|
| 578 |
+
finally { if (_sl && !_sl.classList.contains("error")) _sl.classList.remove("active"); }
|
| 579 |
if (gen !== loadGen) return; // user already switched away — drop this load
|
| 580 |
model = new THREE.Group();
|
| 581 |
// Shipped GLBs are Y-up (Blender glTF export); catalog pivots/axes are also
|