Improve error message

Co-authored-by: Nelson Chan <3271800+chakflying@users.noreply.github.com>
This commit is contained in:
rouja 2025-04-28 08:57:01 +02:00 committed by Jacques ROUSSEL
parent ec7d0edc95
commit 546afad73c

View file

@ -56,8 +56,9 @@ class TCPMonitorType extends MonitorType {
heartbeat.msg = "Certificate is invalid";
}
} catch (error) {
const message = error instanceof Error ? error.message : "Unknown error";
heartbeat.status = DOWN;
heartbeat.msg = "Connection failed";
heartbeat.msg = `TLS Connection failed: ${message}`;
} finally {
if (socket && !socket.destroyed) {
socket.end();