From c7fa1458463ab421f5dd93bbc77f4269faa32283 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Wed, 3 Jul 2024 22:00:47 +0800 Subject: [PATCH] windows: wrap the error with context info in eventloop.close() --- eventloop_windows.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eventloop_windows.go b/eventloop_windows.go index ea053a87d..565f3ef30 100644 --- a/eventloop_windows.go +++ b/eventloop_windows.go @@ -18,6 +18,7 @@ import ( "bytes" "context" "errors" + "fmt" "runtime" "sync/atomic" "time" @@ -195,7 +196,7 @@ func (el *eventloop) close(c *conn, err error) error { err = c.rawConn.Close() c.release() if err != nil { - return err + return fmt.Errorf("failed to close connection=%s in event-loop(%d): %v", c.remoteAddr, el.idx, err) } return el.handleAction(c, action)