Skip to content

Commit

Permalink
perf: don't catch 404 throw
Browse files Browse the repository at this point in the history
This catches all exceptions, so e.g., a json parsing error is completely
swallowed without even appearing in the JS console, which makes
debugging difficult.

For golang/go#48803.

Change-Id: If62f153413cdb2dfbeab2d83ddf6aaedc43cce8c
Reviewed-on: https://go-review.googlesource.com/c/build/+/413577
Reviewed-by: Michael Knyszek <[email protected]>
  • Loading branch information
prattmic committed Jun 23, 2022
1 parent d6816b3 commit e6724bd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions perf/app/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ <h2 class="Dashboard-title" id="loading">Loading...</h2>
fetch(dataURL)
.then(response => {
if (!response.ok) {
failure(benchmark);
throw new Error("Data fetch failed");
}
return response.json();
Expand All @@ -137,10 +138,7 @@ <h2 class="Dashboard-title" id="loading">Loading...</h2>
});

addContent(benchmarks);
})
// This will look odd if the error isn't a 404 and benchmark is
// undefined, but close enough.
.catch(error => failure(benchmark));
});
</script>

</body>
Expand Down

0 comments on commit e6724bd

Please sign in to comment.