How to use the @node-red/util.log.error function in @node-red/util

To help you get started, we’ve selected a few @node-red/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-red / node-red / packages / node_modules / @node-red / editor-api / lib / util.js View on Github external
errorHandler: function(err,req,res,next) {
        //TODO: why this when rejectHandler also?!

        if (err.message === "request entity too large") {
            log.error(err);
        } else {
            log.error(err.stack);
        }
        log.audit({event: "api.error",error:err.code||"unexpected_error",message:err.toString()},req);
        res.status(400).json({error:"unexpected_error", message:err.toString()});
    },
github node-red / node-red / packages / node_modules / @node-red / editor-api / lib / util.js View on Github external
errorHandler: function(err,req,res,next) {
        //TODO: why this when rejectHandler also?!

        if (err.message === "request entity too large") {
            log.error(err);
        } else {
            log.error(err.stack);
        }
        log.audit({event: "api.error",error:err.code||"unexpected_error",message:err.toString()},req);
        res.status(400).json({error:"unexpected_error", message:err.toString()});
    },
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / flows / util.js View on Github external
mapEnvVarProperties(conf,p,flow);
                    }
                }
                try {
                    Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
                    newNode = new nodeTypeConstructor(conf);
                } catch (err) {
                    Log.log({
                        level: Log.ERROR,
                        id:conf.id,
                        type: type,
                        msg: err
                    });
                }
            } else {
                Log.error(Log._("nodes.flow.unknown-type", {type:type}));
            }
        } catch(err) {
            Log.error(err);
        }
        return newNode;
    }
}
github node-red / node-red / packages / node_modules / @node-red / editor-api / lib / editor / index.js View on Github external
runtimeAPI.isStarted().then( started => {
        if (!started) {
            log.error("Node-RED runtime not started");
            res.status(503).send("Not started");
        } else {
            next()
        }
    })
}
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / flows / util.js View on Github external
try {
                    Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
                    newNode = new nodeTypeConstructor(conf);
                } catch (err) {
                    Log.log({
                        level: Log.ERROR,
                        id:conf.id,
                        type: type,
                        msg: err
                    });
                }
            } else {
                Log.error(Log._("nodes.flow.unknown-type", {type:type}));
            }
        } catch(err) {
            Log.error(err);
        }
        return newNode;
    }
}
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / context / localfilesystem.js View on Github external
return self._flushPendingWrites.call(self).catch(function(err) {
                log.error(log._("context.localfilesystem.error-write",{message:err.toString()}));
            });
        });