🥅 Improved error-handling

This commit is contained in:
Mawoka
2022-06-09 16:13:44 +02:00
parent 34c5adc1a5
commit d0f46e3684
+1
View File
@@ -62,6 +62,7 @@
if (res.status !== 200) { if (res.status !== 200) {
alert('Failed to start game!'); alert('Failed to start game!');
console.error(`Failed to start game, ${await res.text()}`); console.error(`Failed to start game, ${await res.text()}`);
window.location.replace('/account/login?returnTo=/overview');
} }
const data = await res.json(); const data = await res.json();
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef