WebTransportError now implemented correctly
This commit is contained in:
parent
313787cf55
commit
96c16f5dd4
|
|
@ -20,14 +20,18 @@ async function sessionStartupAnimation()
|
||||||
let all_default_elements = document.body.querySelectorAll("*");
|
let all_default_elements = document.body.querySelectorAll("*");
|
||||||
all_default_elements.forEach((elem) => elem.style.opacity = 0);
|
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();
|
let xmlhttp = new XMLHttpRequest();
|
||||||
|
|
||||||
// Not the most optimised way, but it's working
|
|
||||||
xmlhttp.open("GET", "assets/startup_quotes.json", false);
|
xmlhttp.open("GET", "assets/startup_quotes.json", false);
|
||||||
xmlhttp.send();
|
xmlhttp.send();
|
||||||
if(xmlhttp.status != 200)
|
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"];
|
let quotes = JSON.parse(xmlhttp.responseText)["quotes"];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue