Simplify error catch

Co-Authored-By: Frank Elsinga <frank.elsinga@tum.de>
pull/4717/head
Matt Visnovsky 7 months ago
parent 1fe1bb5864
commit 433e317eee

@ -76,15 +76,10 @@ 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}`;
}
}
}
}

Loading…
Cancel
Save