Skip to content

Commit

Permalink
fix: does not support error-wrapping directive %w
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Feb 17, 2023
1 parent 500512f commit cf3f877
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/service/upyun.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (c *Upyun) VerifyImageUploadCallback(ctx *fiber.Ctx) (path string, err erro
body := ctx.Body()
v, err := url.ParseQuery(string(body))
if err != nil {
return "", errors.Errorf("failed to parse body: %w", err)
return "", errors.Wrap(err, "failed to parse body")
}

if v.Get("code") != "200" {
Expand All @@ -114,7 +114,7 @@ func (c *Upyun) VerifyImageUploadCallback(ctx *fiber.Ctx) (path string, err erro
timeStr := v.Get("time")
timeInt, err := strconv.Atoi(timeStr)
if err != nil {
return "", errors.Errorf("failed to parse time: %w", err)
return "", errors.Wrap(err, "failed to parse time")
}
timeT := time.Unix(int64(timeInt), 0)
if timeT.Before(time.Now().Add(-time.Minute * 10)) {
Expand Down

0 comments on commit cf3f877

Please sign in to comment.