2ca5303deabc42182eae8cb7f49c2c8e9784eabf jcasper Mon Mar 30 09:30:45 2026 -0700 Added an error message for when the metadata file is missing for a faceted composite, refs #36320 diff --git src/hg/js/facetedComposite.js src/hg/js/facetedComposite.js index a34426b6653..4df32b24c4f 100644 --- src/hg/js/facetedComposite.js +++ src/hg/js/facetedComposite.js @@ -685,30 +685,38 @@ const colNames = rows[0].split("\t"); const metadata = rows.slice(1).map(row => { const values = row.split("\t"); const obj = {}; colNames.forEach((attrib, i) => { obj[attrib] = values[i]; }); return obj; }); const rowToIdx = Object.fromEntries( metadata.map((row, i) => [row[primaryKey], i]) ); colorMap = isValidColorMap(colorMap) ? colorMap : null; const freshData = { metadata, rowToIdx, colNames, colorMap }; initAll(freshData); }); + }) + .catch(err => { + const table = document.getElementById("theMetaDataTable"); + if (table) { + table.innerHTML = + `<tr><td style="padding:20px;color:#a00;">` + + `Error loading metadata: ${err.message}</td></tr>`; + } }); } // end loadDataAndInit CSS_URLS.map(href => // load all the CSS document.head.appendChild(Object.assign( document.createElement("link"), { rel: "stylesheet", href }))); document.addEventListener("keydown", e => { // block accidental submit if (e.key === "Enter") { e.preventDefault(); e.stopPropagation(); } }, true); // ADS: only load plugins if they are not already loaded loadIfMissing(!$.fn.DataTable, DATATABLES_URL, () => { loadIfMissing(!$.fn.dataTable.select, DATATABLES_SELECT_URL, () => { generateHTML();