Skip to content

Commit 0fe99cc

Browse files
authored
If rendering has failed due to a net.OpError stop rendering (attempt 2) (#19049) (#19056)
Backport #19049 Unfortunately #18642 does not work because a `*net.OpError` does not implement the `Is` interface to make `errors.Is` work correctly - thus leading to the irritating conclusion that a `*net.OpError` is not a `*net.OpError`. Here we keep the `errors.Is` because presumably this will be fixed at some point in the golang main source code but also we add a simply type cast to also check. Fix #18629 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 580401e commit 0fe99cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func (ctx *Context) ServerError(logMsg string, logErr error) {
266266
func (ctx *Context) serverErrorInternal(logMsg string, logErr error) {
267267
if logErr != nil {
268268
log.ErrorWithSkip(2, "%s: %v", logMsg, logErr)
269-
if errors.Is(logErr, &net.OpError{}) {
269+
if _, ok := logErr.(*net.OpError); ok || errors.Is(logErr, &net.OpError{}) {
270270
// This is an error within the underlying connection
271271
// and further rendering will not work so just return
272272
return

0 commit comments

Comments
 (0)