From f91f7e5b0c7f6b61fa2c80fb4b9a7e99d6853e45 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 12 Sep 2024 09:27:49 +0100 Subject: [PATCH] request: return error in write.Flush call --- request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/request.go b/request.go index 0a999e5..2f619ec 100644 --- a/request.go +++ b/request.go @@ -278,7 +278,10 @@ func (c *RequestClient) RawRequest(request RawRequest) (response RawResponse, er if err != nil { return nil, fmt.Errorf("error while writing to socket: %w", err) } - writer.Flush() + err = writer.Flush() + if err != nil { + return nil, fmt.Errorf("error while flushing to socket: %w", err) + } // Get the response back rbuf := bytes.NewBuffer(nil)