Skip to content

Commit

Permalink
Fix nil error and wrap the error
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Oct 8, 2023
1 parent 5cb26b2 commit 57bc655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions network/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ func (pr *Proxy) PassThroughToServer(conn net.Conn) *gerr.GatewayDError {
}
span.AddEvent("Ran the OnTrafficFromClient hooks")

if errors.Is(origErr, io.EOF) {
if origErr != nil && errors.Is(origErr, io.EOF) {
// Client closed the connection.
span.AddEvent("Client closed the connection")
return gerr.ErrClientNotConnected
return gerr.ErrClientNotConnected.Wrap(origErr)
}

// If the hook wants to terminate the connection, do it.
Expand Down

0 comments on commit 57bc655

Please sign in to comment.