WebTransportError now implemented correctly

This commit is contained in:
Ulysse Cura 2026-03-10 21:07:48 +01:00
parent 313787cf55
commit 96c16f5dd4
1 changed files with 6 additions and 2 deletions

View File

@ -20,14 +20,18 @@ async function sessionStartupAnimation()
let all_default_elements = document.body.querySelectorAll("*");
all_default_elements.forEach((elem) => elem.style.opacity = 0);
// Get quotes possibilities
// Not the most optimised way, but it's working
let xmlhttp = new XMLHttpRequest();
// Not the most optimised way, but it's working
xmlhttp.open("GET", "assets/startup_quotes.json", false);
xmlhttp.send();
if(xmlhttp.status != 200)
{
throw WebTransportError("The file 'assets/startup_quots.json' is not available");
throw new WebTransportError({
message: "The file 'assets/startup_quotes.json' is not available",
streamErrorCode: xmlhttp.status
});
}
let quotes = JSON.parse(xmlhttp.responseText)["quotes"];