Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
Rebuilderd Website
Commits
7432ee4d
Commit
7432ee4d
authored
May 09, 2020
by
Jelle van der Waa
🚧
Browse files
Add error handling when fetch fails
When the rebuild API is not available or errors out, show a notification.
parent
0124025b
Changes
3
Hide whitespace changes
Inline
Side-by-side
dist/index.html
View file @
7432ee4d
...
...
@@ -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"
>
...
...
src/index.js
View file @
7432ee4d
...
...
@@ -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
=
''
;
});
src/style.scss
View file @
7432ee4d
...
...
@@ -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"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment