From 452264854c9d245c295b1c79d1b5b3541399690d Mon Sep 17 00:00:00 2001 From: monoxane Date: Thu, 28 Nov 2024 01:19:19 +1100 Subject: [PATCH] fix: properly return error on connection failure --- pkg/tbus/tbus.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/tbus/tbus.go b/pkg/tbus/tbus.go index 5a2ecc3..9f336d1 100644 --- a/pkg/tbus/tbus.go +++ b/pkg/tbus/tbus.go @@ -56,7 +56,10 @@ func (tbus *TBusGateway) Connect() error { conn, err := net.Dial("tcp", tbus.IP.String()+":5000") if err != nil { nk.Log.Error().Err(err).Msg("unable to connect to tbus gateway") + + return errors.Wrap(err, "unable to connect to tbus gateway") } + tbus.conn = conn defer tbus.conn.Close()