Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
innodreamer committed Jul 22, 2024
2 parents 72add2b + a97d68c commit 7d4cb08
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ <h2>Multi-Cloud Price Info</h2>
if (filterList) {
apiURL += ` -H 'Content-Type: application/json' -d '${filterList}'`
}
parent.frames["log_frame"].Log("curl -sX GET http://" + `${hostname}` + ":" + `${port}` + apiURL);
try {
parent.frames["log_frame"].Log("curl -sX GET http://" + `${hostname}` + ":" + `${port}` + apiURL);
} catch (e) {
// Do nothing if error occurs
}

let fetchText = 'fetching';
let intervalId = setInterval(() => {
Expand All @@ -333,17 +337,25 @@ <h2>Multi-Cloud Price Info</h2>
.then(data => {
clearInterval(intervalId); // stop the interval
fetchOverlayContent.srcdoc = data; // set the HTML content in the iframe

// logging the fetch success
parent.frames["log_frame"].Log(" ==> Fetch Success");

try {
// logging the fetch success
parent.frames["log_frame"].Log(" ==> Fetch Success");
} catch (e) {
// Do nothing if error occurs
}
})
.catch(error => {
console.error('Error:', error);
alert(error);
clearInterval(intervalId); // when error occurs, stop the interval

// logging the fetch error
parent.frames["log_frame"].Log(" ==> Fetch Error: " + error.message);
try {
// logging the fetch error
parent.frames["log_frame"].Log(" ==> Fetch Error: " + error.message);
} catch (e) {
// Do nothing if error occurs
}
});
}

Expand Down

0 comments on commit 7d4cb08

Please sign in to comment.