Skip to content

Commit

Permalink
define details with null lists on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Nov 28, 2024
1 parent a9614c2 commit 85f4108
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/StatusDashboard/current_migrations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,24 @@ function fetchContent(onLoad, setState) {
for (const { name } of fetched[status]) {
promises.push(
(async (index) => {
let details;
try {
const url = urls.migrations.details.replace("<NAME>", name);
const response = await fetch(url);
const details = await response.json();
fetched[status][index].details = details;
fetched[status][index].progress = measureProgress(details);
details = await response.json();
} catch (error) {
console.warn(`error loading migration: ${name}`, error);
details = {
"done": [],
"in-pr": [],
"awaiting-pr": [],
"awaiting-parents": [],
"not-solvable": [],
"bot-error": [],
}
}
fetched[status][index].details = details;
fetched[status][index].progress = measureProgress(details);
})(count++)
);
}
Expand All @@ -301,6 +310,7 @@ function fetchContent(onLoad, setState) {
regular: patch.sort?.regular || prev.sort.regular,
paused: patch.sort?.paused || prev.sort.paused
};
console.log(fetched);
const result = {
...prev,
...patch,
Expand Down

0 comments on commit 85f4108

Please sign in to comment.