Skip to content

Commit

Permalink
feat: export ErrMissingFile
Browse files Browse the repository at this point in the history
* closes cloudwego#1138

This follows the std library approach: https://pkg.go.dev/net/http#ErrMissingFile
  • Loading branch information
kamikazechaser committed Jun 20, 2024
1 parent 2a16d50 commit f8bd8a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/protocol/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import (
)

var (
errMissingFile = errors.NewPublic("http: no such file")
ErrMissingFile = errors.NewPublic("http: no such file")

responseBodyPool bytebufferpool.Pool
requestBodyPool bytebufferpool.Pool
Expand Down Expand Up @@ -313,7 +313,7 @@ func (req *Request) FormFile(name string) (*multipart.FileHeader, error) {
}
fhh := mf.File[name]
if fhh == nil {
return nil, errMissingFile
return nil, ErrMissingFile
}
return fhh[0], nil
}
Expand Down

0 comments on commit f8bd8a2

Please sign in to comment.