Skip to content

Commit

Permalink
refactor: simplify error handling for multipart form reading
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Dec 6, 2024
1 parent 1a01022 commit 7b2fa2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion huma.go
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ func Register[I, O any](api API, op Operation, handler func(context.Context, *I)

if rawBodyMultipart || rawBodyDecodedMultipart {
form, err := ctx.GetMultipartForm()
if err != nil || form == nil {
if err != nil {
res.Errors = append(res.Errors, &ErrorDetail{
Location: "body",
Message: "cannot read multipart form: " + err.Error(),
Expand Down

0 comments on commit 7b2fa2c

Please sign in to comment.