mime/multipart: use %w when wrapping error in NextPart

Use "%w" instead of "%v" as format verb for error value in the NextPart
method. This way it will be possible to use common go error utilities
from std library when parsing from custom io.Readers.

This issue was discovered during attempts to use
http.Request.ParseMultipartForm together with http.MaxBytesHandler.
This commit is contained in:
thinkofher 2022-09-18 21:20:05 +02:00
parent 63d05642d4
commit 8bc49c945c
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -360,7 +360,7 @@ func (r *Reader) nextPart(rawPart bool) (*Part, error) {
return nil, io.EOF
}
if err != nil {
return nil, fmt.Errorf("multipart: NextPart: %v", err)
return nil, fmt.Errorf("multipart: NextPart: %w", err)
}
if r.isBoundaryDelimiterLine(line) {