Skip to content

Commit 1bcbff8

Browse files
committed
Fixed the check because MinIO wraps the error.
1 parent 1c3ac29 commit 1bcbff8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/lfs/server.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// Copyright 2020 The Gitea Authors. All rights reserved.
1+
// Copyright 2021 The Gitea Authors. All rights reserved.
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

55
package lfs
66

77
import (
88
"encoding/base64"
9+
"errors"
910
"fmt"
1011
"io"
1112
"net/http"
@@ -291,7 +292,7 @@ func UploadHandler(ctx *context.Context) {
291292

292293
defer ctx.Req.Body.Close()
293294
if err := contentStore.Put(meta.Pointer, ctx.Req.Body); err != nil {
294-
if err == lfs_module.ErrSizeMismatch || err == lfs_module.ErrHashMismatch {
295+
if errors.Is(err, lfs_module.ErrSizeMismatch) || errors.Is(err, lfs_module.ErrHashMismatch) {
295296
writeStatusMessage(ctx, http.StatusUnprocessableEntity, err.Error())
296297
} else {
297298
writeStatus(ctx, http.StatusInternalServerError)

0 commit comments

Comments
 (0)