Play UI: improve rendering of errors from JSON formats

This commit is contained in:
Alexey Milovidov 2024-01-28 13:44:56 +01:00
parent f2bad692e2
commit 9dd6362ae7

View File

@ -993,7 +993,16 @@
function renderError(response)
{
clear();
document.getElementById('error').innerText = response ? response : "No response.";
let message = response;
try {
let json = JSON.parse(response);
if (json.exception) {
message = json.exception;
}
} catch (e) {}
document.getElementById('error').innerText = message ? message : "No response.";
document.getElementById('error').style.display = 'block';
document.getElementById('logo-container').style.display = 'none';
}