summaryrefslogtreecommitdiffstats
path: root/services/lfs
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-04-12 16:23:57 -0400
committerGitHub <noreply@github.com>2023-04-12 16:23:57 -0400
commit93c7611c323e08e795dbf8c295eed451d89bf37e (patch)
treea5b3d7c6dfbf8359156ea0f006af6a314f427354 /services/lfs
parent607801ec41bcb85bc24dbdf31ad37a04735dce27 (diff)
downloadgitea-93c7611c323e08e795dbf8c295eed451d89bf37e.tar.gz
gitea-93c7611c323e08e795dbf8c295eed451d89bf37e.zip
Improve LFS error logs (#24072) (#24082)
Backport #24072 by @wxiaoguang The error logs were not clear. Help (but not fix) #24053 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/lfs')
-rw-r--r--services/lfs/server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/lfs/server.go b/services/lfs/server.go
index 758f4ebfe0..d63d08ce01 100644
--- a/services/lfs/server.go
+++ b/services/lfs/server.go
@@ -126,7 +126,6 @@ func DownloadHandler(ctx *context.Context) {
_, err = content.Seek(fromByte, io.SeekStart)
if err != nil {
log.Error("Whilst trying to read LFS OID[%s]: Unable to seek to %d Error: %v", meta.Oid, fromByte, err)
-
writeStatus(ctx, http.StatusInternalServerError)
return
}
@@ -334,10 +333,11 @@ func UploadHandler(ctx *context.Context) {
log.Error("Upload does not match LFS MetaObject [%s]. Error: %v", p.Oid, err)
writeStatusMessage(ctx, http.StatusUnprocessableEntity, err.Error())
} else {
+ log.Error("Error whilst uploadOrVerify LFS OID[%s]: %v", p.Oid, err)
writeStatus(ctx, http.StatusInternalServerError)
}
if _, err = git_model.RemoveLFSMetaObjectByOid(ctx, repository.ID, p.Oid); err != nil {
- log.Error("Error whilst removing metaobject for LFS OID[%s]: %v", p.Oid, err)
+ log.Error("Error whilst removing MetaObject for LFS OID[%s]: %v", p.Oid, err)
}
return
}
@@ -365,6 +365,7 @@ func VerifyHandler(ctx *context.Context) {
status := http.StatusOK
if err != nil {
+ log.Error("Error whilst verifying LFS OID[%s]: %v", p.Oid, err)
status = http.StatusInternalServerError
} else if !ok {
status = http.StatusNotFound