Simplify error catch

Co-Authored-By: Frank Elsinga <frank.elsinga@tum.de>
This commit is contained in:
Matt Visnovsky 2024-05-06 09:57:13 -06:00
parent 1fe1bb5864
commit 433e317eee

View File

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