From 7dbaeef3d8b6573a9221e27168e7894b0cb08d78 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Wed, 12 Jun 2024 10:01:36 +0100 Subject: [PATCH] Return error from proxy Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- pkg/proxy.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/proxy.go b/pkg/proxy.go index d5d8567..daad079 100644 --- a/pkg/proxy.go +++ b/pkg/proxy.go @@ -75,18 +75,17 @@ func (p *Proxy) Start() error { // Wait for a connection. conn, err := l.Accept() if err != nil { - acceptErr := fmt.Errorf("unable to accept on %d, error: %s", + log.Printf("Unable to accept on: %d, error: %s", p.Port, err.Error()) - log.Printf("%s", acceptErr.Error()) - return acceptErr + return err } upstream, err := net.Dial("tcp", upstreamAddr) if err != nil { conn.Close() - log.Printf("unable to dial to %s, error: %s", upstreamAddr, err.Error()) + log.Printf("Unable to dial: %s, error: %s", upstreamAddr, err.Error()) return err }