1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-05-06 03:20:41 +02:00

add return for error handle (#4502)

This commit is contained in:
wusong 2023-05-24 22:45:06 +08:00 committed by GitHub
parent ddd1de1beb
commit e7f4418855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,6 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/util/mem"
"io" "io"
"math" "math"
"mime" "mime"
@ -15,6 +13,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/util/mem"
"github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/images" "github.com/seaweedfs/seaweedfs/weed/images"
@ -139,6 +140,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
entry.GetChunks(), 0, math.MaxInt64); err != nil { entry.GetChunks(), 0, math.MaxInt64); err != nil {
err = fmt.Errorf("failed to resolve chunk manifest, err: %s", err.Error()) err = fmt.Errorf("failed to resolve chunk manifest, err: %s", err.Error())
writeJsonError(w, r, http.StatusInternalServerError, err) writeJsonError(w, r, http.StatusInternalServerError, err)
return
} }
} }
writeJsonQuiet(w, r, http.StatusOK, entry) writeJsonQuiet(w, r, http.StatusOK, entry)