mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 17:34:11 -05:00
Backport #24072 by @wxiaoguang The error logs were not clear. Help (but not fix) #24053 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
607801ec41
commit
93c7611c32
1 changed files with 3 additions and 2 deletions
|
@ -126,7 +126,6 @@ func DownloadHandler(ctx *context.Context) {
|
||||||
_, err = content.Seek(fromByte, io.SeekStart)
|
_, err = content.Seek(fromByte, io.SeekStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Whilst trying to read LFS OID[%s]: Unable to seek to %d Error: %v", meta.Oid, fromByte, err)
|
log.Error("Whilst trying to read LFS OID[%s]: Unable to seek to %d Error: %v", meta.Oid, fromByte, err)
|
||||||
|
|
||||||
writeStatus(ctx, http.StatusInternalServerError)
|
writeStatus(ctx, http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -334,10 +333,11 @@ func UploadHandler(ctx *context.Context) {
|
||||||
log.Error("Upload does not match LFS MetaObject [%s]. Error: %v", p.Oid, err)
|
log.Error("Upload does not match LFS MetaObject [%s]. Error: %v", p.Oid, err)
|
||||||
writeStatusMessage(ctx, http.StatusUnprocessableEntity, err.Error())
|
writeStatusMessage(ctx, http.StatusUnprocessableEntity, err.Error())
|
||||||
} else {
|
} else {
|
||||||
|
log.Error("Error whilst uploadOrVerify LFS OID[%s]: %v", p.Oid, err)
|
||||||
writeStatus(ctx, http.StatusInternalServerError)
|
writeStatus(ctx, http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
if _, err = git_model.RemoveLFSMetaObjectByOid(ctx, repository.ID, p.Oid); err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
@ -365,6 +365,7 @@ func VerifyHandler(ctx *context.Context) {
|
||||||
|
|
||||||
status := http.StatusOK
|
status := http.StatusOK
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error("Error whilst verifying LFS OID[%s]: %v", p.Oid, err)
|
||||||
status = http.StatusInternalServerError
|
status = http.StatusInternalServerError
|
||||||
} else if !ok {
|
} else if !ok {
|
||||||
status = http.StatusNotFound
|
status = http.StatusNotFound
|
||||||
|
|
Loading…
Reference in a new issue