aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/git-lfs-server
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/git-lfs-server')
-rw-r--r--cmd/git-lfs-server/main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/git-lfs-server/main.go b/cmd/git-lfs-server/main.go
index 3bb1173..0379117 100644
--- a/cmd/git-lfs-server/main.go
+++ b/cmd/git-lfs-server/main.go
@@ -372,7 +372,16 @@ func (h *handler) handlePutObject(w http.ResponseWriter, r *http.Request, repo,
372 SendContentMd5: true, 372 SendContentMd5: true,
373 }) 373 })
374 if err != nil { 374 if err != nil {
375 makeRespError(ctx, w, "Failed to upload object", http.StatusInternalServerError) 375 if errors.Is(err, errBadSum) {
376 makeRespError(ctx, w, "Bad checksum (OID does not match contents)", http.StatusBadRequest)
377 } else if errors.Is(err, errTooSmall) {
378 makeRespError(ctx, w, "Uploaded object smaller than expected", http.StatusBadRequest)
379 } else if errors.Is(err, errTooBig) {
380 makeRespError(ctx, w, "Uploaded object bigger than expected", http.StatusBadRequest)
381 } else {
382 reqlog(ctx, "Failed to upload object: %s", err)
383 makeRespError(ctx, w, "Failed to upload object", http.StatusInternalServerError)
384 }
376 return 385 return
377 } 386 }
378} 387}