Default: invalid condition error

Co-Authored-By: Frank Elsinga <frank.elsinga@tum.de>
This commit is contained in:
Matt Visnovsky 2024-05-06 09:51:37 -06:00
parent 0384b34007
commit 997791bc78

View file

@ -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}`;