From 997791bc78243180b69b8d0cf0039c9f68d9e7c5 Mon Sep 17 00:00:00 2001 From: Matt Visnovsky Date: Mon, 6 May 2024 09:51:37 -0600 Subject: [PATCH] Default: invalid condition error Co-Authored-By: Frank Elsinga --- server/monitor-types/snmp.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/monitor-types/snmp.js b/server/monitor-types/snmp.js index 8b745d20a..0e5ded37e 100644 --- a/server/monitor-types/snmp.js +++ b/server/monitor-types/snmp.js @@ -70,9 +70,7 @@ class SNMPMonitorType extends MonitorType { heartbeat.status = snmpValue.toString().includes(snmpControlValue.toString()) ? UP : DOWN; break; default: - heartbeat.status = DOWN; - heartbeat.msg = `Invalid condition: ${monitor.snmpCondition}`; - break; + throw new Error(`Invalid condition ${monitor.snmpCondition}`); } heartbeat.msg = "SNMP value " + (heartbeat.status ? "passes" : "does not pass") + ` comparison: ${value.toString()} ${monitor.snmpCondition} ${snmpControlValue}`;