XML Formatter now shows exact error

This commit is contained in:
2023-03-01 09:38:12 +01:00
parent 8a863b7650
commit c6ee630018
2 changed files with 8 additions and 3 deletions

View File

@@ -148,6 +148,7 @@ function performRequest(endpoint, checkXML, checkTransform){
}
function performFormatRequest(endpoint, checkXML, sourceId, targetId){
const infoElementId = "formatinfo";
const port = 8082;
var xmlData = document.getElementById(sourceId).value.trim();
@@ -160,12 +161,17 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId){
if (!empty) {
restRequest(port, endpoint, xmlData, "").then(function(result) {
console.log(result);
if (result.status == "OK") {
document.getElementById(targetId).value = result.result;
document.getElementById(targetId).style.backgroundColor = null;
document.getElementById(infoElementId).innerText = ' Computed'.concat(" in ", result.time, "ms.");
document.getElementById(infoElementId).style.color = "#30aa58";
}
else {
document.getElementById(targetId).style.backgroundColor = color_red;
document.getElementById(infoElementId).innerText = result.result;
document.getElementById(infoElementId).style.color = "#aa3030";
}
});