From 433e317eeedb49bb62e284e7928b8ef83d0f918c Mon Sep 17 00:00:00 2001 From: Matt Visnovsky Date: Mon, 6 May 2024 09:57:13 -0600 Subject: [PATCH] Simplify error catch Co-Authored-By: Frank Elsinga --- server/monitor-types/snmp.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/server/monitor-types/snmp.js b/server/monitor-types/snmp.js index e6496c505..b1676f53e 100644 --- a/server/monitor-types/snmp.js +++ b/server/monitor-types/snmp.js @@ -76,13 +76,8 @@ class SNMPMonitorType extends MonitorType { session.close(); } catch (err) { - if (err instanceof snmp.RequestTimedOutError) { - heartbeat.status = DOWN; - heartbeat.msg = `SNMP Error: Timed out after ${monitor.timeout} seconds`; - } else { - heartbeat.status = DOWN; - heartbeat.msg = `SNMP Error: ${err.message}`; - } + heartbeat.status = DOWN; + heartbeat.msg = `SNMP Error: ${err.message}`; } }