diff --git a/gapit-snmp.js b/gapit-snmp.js index be90c65..8f7e8ba 100644 --- a/gapit-snmp.js +++ b/gapit-snmp.js @@ -373,6 +373,11 @@ module.exports = function (RED) { sessions[sessionKey] = snmp.createSession(host, node.config.community, options); } + sessions[sessionKey].on("error", function (error) { + console.log ("Session error: " + error.toString()); + node.closeSession(); + }) + node.sessionKey = sessionKey; return sessions[sessionKey]; }