Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
781bdf8c
Commit
781bdf8c
authored
May 17, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error handling in mainpage and stats.
parent
91fa6937
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
static/mainpage.js
static/mainpage.js
+8
-3
static/stats.js
static/stats.js
+6
-2
No files found.
static/mainpage.js
View file @
781bdf8c
...
@@ -33,10 +33,15 @@ async function listPublicGroups() {
...
@@ -33,10 +33,15 @@ async function listPublicGroups() {
let
l
;
let
l
;
try
{
try
{
l
=
await
(
await
fetch
(
'
/public-groups.json
'
)).
json
();
let
r
=
await
fetch
(
'
/public-groups.json
'
);
if
(
!
r
.
ok
)
throw
new
Error
(
`
${
r
.
status
}
${
r
.
statusText
}
`
);
l
=
await
r
.
json
();
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
);
table
.
textContent
=
`Couldn't fetch groups:
${
e
}
`
;
l
=
[];
div
.
classList
.
remove
(
'
nogroups
'
);
div
.
classList
.
add
(
'
groups
'
);
return
;
}
}
if
(
l
.
length
===
0
)
{
if
(
l
.
length
===
0
)
{
...
...
static/stats.js
View file @
781bdf8c
...
@@ -25,10 +25,14 @@ async function listStats() {
...
@@ -25,10 +25,14 @@ async function listStats() {
let
l
;
let
l
;
try
{
try
{
l
=
await
(
await
fetch
(
'
/stats.json
'
)).
json
();
let
r
=
await
fetch
(
'
/stats.json
'
);
if
(
!
r
.
ok
)
throw
new
Error
(
`
${
r
.
status
}
${
r
.
statusText
}
`
);
l
=
await
r
.
json
();
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
);
console
.
error
(
e
);
l
=
[];
table
.
textContent
=
`Couldn't fetch stats:
${
e
}
`
;
return
;
}
}
if
(
l
.
length
===
0
)
{
if
(
l
.
length
===
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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