Skip to content
Snippets Groups Projects
Commit 7432ee4d authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

Add error handling when fetch fails

When the rebuild API is not available or errors out, show a
notification.
parent 0124025b
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,8 @@
</div>
</div>
</section>
<section class="section">
<div id="bad" class="tile box has-background-danger">
<section id="bad" class="section">
<div class="tile box has-background-danger">
<div class="content">
<p class='title is-5 has-text-white'>Unreproducible packages</p>
<ul id="packagesul">
......
......@@ -79,4 +79,13 @@ fetch(`${apiPrefix}/api/v0/pkgs/list`).then((response) => {
displayStats(suites);
displayBadPackages(suites);
}).catch(() => {
const elem = document.getElementById('status');
const div = document.createElement('div');
div.textContent = 'An unexpected erorr occurred fetching the rebuild status';
div.className = 'notification is-danger';
elem.appendChild(div);
const bad = document.getElementById('bad');
bad.innerHTML = '';
});
......@@ -8,6 +8,7 @@ $link: #212952;
@import "../node_modules/bulma/sass/elements/container.sass";
@import "../node_modules/bulma/sass/elements/box.sass";
@import "../node_modules/bulma/sass/elements/title.sass";
@import "../node_modules/bulma/sass/elements/notification.sass";
@import "../node_modules/bulma/sass/layout/footer.sass";
@import "../node_modules/bulma/sass/layout/hero.sass";
@import "../node_modules/bulma/sass/layout/section.sass";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment