mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Fix cases where we are wrapping a nil error
This was using `errors.Wrap` when there was no error to wrap, meanwhile
we are supposed to be creating a new error.
Found this while investigating some log corruption issues and
unexpectedly getting a nil reader and a nil error from `getTailReader`.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 0a48d26fbc)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
committed by
Paweł Gronowski
parent
e633d64982
commit
e264217787
@@ -66,7 +66,7 @@ func getTailReader(ctx context.Context, r loggerutils.SizeReaderAt, req int) (io
|
|||||||
}
|
}
|
||||||
|
|
||||||
if msgLen != binary.BigEndian.Uint32(buf) {
|
if msgLen != binary.BigEndian.Uint32(buf) {
|
||||||
return nil, 0, errdefs.DataLoss(errors.Wrap(err, "log message header and footer indicate different message sizes"))
|
return nil, 0, errdefs.DataLoss(errors.New("log message header and footer indicate different message sizes"))
|
||||||
}
|
}
|
||||||
|
|
||||||
found++
|
found++
|
||||||
|
|||||||
Reference in New Issue
Block a user