Skip to content

Commit 8a90039

Browse files
authored
Catch html errors in loadData
1 parent 5bf00d4 commit 8a90039

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

devops/scripts/benchmarks/html/scripts.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,10 @@ function loadData() {
955955
if (typeof remoteDataUrl !== 'undefined' && remoteDataUrl !== '') {
956956
// Fetch data from remote URL
957957
fetch(remoteDataUrl)
958-
.then(response => response.json())
958+
.then(response => {
959+
if (!response.ok) { throw new Error(`Got response status ${response.status}.`) }
960+
return response.json();
961+
})
959962
.then(data => {
960963
benchmarkRuns = data.runs || data;
961964
benchmarkMetadata = data.metadata || benchmarkMetadata || {};

0 commit comments

Comments
 (0)