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; draw_humidity_max = draw_max;
midpoint_humidity = midpoint; midpoint_humidity = midpoint;
} else { } else {
console.log("ERROR! updateAreaVars() called with wrong noise_type!") console.error("updateAreaVars() called with wrong noise_type!")
} }
} }
function updateAreaVars() { function updateAreaVars() {
@ -693,10 +693,10 @@ function getVoronoiDiagram(points, recalculate) {
diagram = voronoi.compute(sites, vbbox); diagram = voronoi.compute(sites, vbbox);
} catch(err) { } catch(err) {
diagram = null; diagram = null;
console.log("Error when calling voronoi.compute from Javascript-Voronoi library!"); console.error("Error when calling voronoi.compute from Javascript-Voronoi library!\n"+
console.log("* exception name: "+err.name); "* exception name: "+err.name+"\n"+
console.log("* exception message: "+err.message); "* exception message: "+err.message+"\n"+
console.log("* stack: "+err.stack); "* stack: "+err.stack);
} finally { } finally {
cachedVoronoiDiagram = diagram; cachedVoronoiDiagram = diagram;
return diagram; return diagram;
@ -791,6 +791,7 @@ function draw(recalculate) {
configDiv.hidden = true; 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."; 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; return false;
} }
@ -1778,16 +1779,16 @@ inputImportSubmit.onclick = function() {
importMessage("Import failed. Not a syntactically valid JSON object. Details: "+details); importMessage("Import failed. Not a syntactically valid JSON object. Details: "+details);
} else { } else {
importMessage("Import failed due to internal error of type '"+err.name+"': "+err.message); importMessage("Import failed due to internal error of type '"+err.name+"': "+err.message);
console.log("Internal error while calling JSON.parse during import!"); console.error("Internal error while calling JSON.parse during import!\n"+
console.log("* name: "+err.name); "* name: "+err.name+"\n"+
console.log("* message: "+err.message); "* message: "+err.message+"\n"+
console.log("* stack: "+err.stack); "* stack: "+err.stack);
} }
return; return;
} }
if (typeof parsedJSON !== "object") { if (typeof parsedJSON !== "object") {
importMessage("Import failed. JSON.parse didnt return an object but it didnt throw an exception?!"); 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; return;
} }