Convert console.log to console.error

This commit is contained in:
Wuzzy 2023-10-26 12:34:22 +02:00
parent ba29a0a0f5
commit 8edfae92cb

View File

@ -192,7 +192,7 @@ function updateAreaVarsFor(noiseType) {
draw_humidity_max = draw_max;
midpoint_humidity = midpoint;
} else {
console.log("ERROR! updateAreaVars() called with wrong noise_type!")
console.error("updateAreaVars() called with wrong noise_type!")
}
}
function updateAreaVars() {
@ -693,10 +693,10 @@ function getVoronoiDiagram(points, recalculate) {
diagram = voronoi.compute(sites, vbbox);
} catch(err) {
diagram = null;
console.log("Error when calling voronoi.compute from Javascript-Voronoi library!");
console.log("* exception name: "+err.name);
console.log("* exception message: "+err.message);
console.log("* stack: "+err.stack);
console.error("Error when calling voronoi.compute from Javascript-Voronoi library!\n"+
"* exception name: "+err.name+"\n"+
"* exception message: "+err.message+"\n"+
"* stack: "+err.stack);
} finally {
cachedVoronoiDiagram = diagram;
return diagram;
@ -791,6 +791,7 @@ function draw(recalculate) {
configDiv.hidden = true;
errorMessage.innerText = "ERROR: Could not get the canvas context which means this tool won't work for you. Maybe your browser does not support the HTML canvas element properly.";
console.error("Could not get the canvas context!");
}
return false;
}
@ -1778,16 +1779,16 @@ inputImportSubmit.onclick = function() {
importMessage("Import failed. Not a syntactically valid JSON object. Details: "+details);
} else {
importMessage("Import failed due to internal error of type '"+err.name+"': "+err.message);
console.log("Internal error while calling JSON.parse during import!");
console.log("* name: "+err.name);
console.log("* message: "+err.message);
console.log("* stack: "+err.stack);
console.error("Internal error while calling JSON.parse during import!\n"+
"* name: "+err.name+"\n"+
"* message: "+err.message+"\n"+
"* stack: "+err.stack);
}
return;
}
if (typeof parsedJSON !== "object") {
importMessage("Import failed. JSON.parse didnt return an object but it didnt throw an exception?!");
console.log("ERROR: JSON.parse didn't return an object although it didn't throw an exception");
console.error("JSON.parse didn't return an object although it didn't throw an exception");
return;
}