Skip to content

Commit

Permalink
Refine Drop method comments to clarify error handling.
Browse files Browse the repository at this point in the history
Explain the rationale for not wrapping errors in the Drop method. Emphasize that the returned error is solely for logging and not for further propagation or processing.
  • Loading branch information
ryanbekhen committed Dec 21, 2024
1 parent 4137cb3 commit 3820d85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,6 @@ func (c *DefaultCtx) setRoute(route *Route) {

// Drop closes the connection without sending a response.
func (c *DefaultCtx) Drop() error {
//nolint:wrapcheck // This must not be wrapped
//nolint:wrapcheck // error wrapping is avoided to keep the operation lightweight and focused on connection closure.
return c.RequestCtx().Conn().Close()
}

0 comments on commit 3820d85

Please sign in to comment.