Skip to content

Commit

Permalink
Return error from proxy
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Jun 12, 2024
1 parent 887c18b commit 7dbaeef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 7dbaeef

Please sign in to comment.