Skip to content

Commit

Permalink
Merge pull request #59303 from ClickHouse/play-rendering-errors-json
Browse files Browse the repository at this point in the history
Play UI: improve rendering of errors from JSON formats
  • Loading branch information
alexey-milovidov committed Jan 28, 2024
2 parents 3103210 + 9dd6362 commit 45cb709
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion programs/server/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 45cb709

Please sign in to comment.