mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Simplify error catch
Co-Authored-By: Frank Elsinga <frank.elsinga@tum.de>
This commit is contained in:
parent
1fe1bb5864
commit
433e317eee
1 changed files with 2 additions and 7 deletions
|
@ -76,15 +76,10 @@ class SNMPMonitorType extends MonitorType {
|
||||||
session.close();
|
session.close();
|
||||||
|
|
||||||
} catch (err) {
|
} 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.status = DOWN;
|
||||||
heartbeat.msg = `SNMP Error: ${err.message}`;
|
heartbeat.msg = `SNMP Error: ${err.message}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue