Function API only Updated 17 Oct 2026
console.error(values)
Writes an error to the site's console log — the same as console.log, but the line is marked as an error (Type "error"). It does not throw or stop the script.
Open the log with the Console button while browsing the folder in Docly, or read it from your own code with docly.getConsoleLog.
Parameters
valuesanyrequiredOne or more values. Objects are written as JSON; several arguments are stored together as one JSON array.
Returns
Nothing. Only API scripts write to the site's console; in pages and templates the line goes to the server's own output, which you cannot see.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
try {
docly.saveJson("Data/order.json", order);
} catch (e) {
console.error("Saving the order failed", e.message);
throw e;
}