mirror of
https://github.com/go-gitea/gitea
synced 2024-10-31 23:34:25 +00:00
Backport #30740 manually Co-authored-by: Chongyi Zheng <git@zcy.dev>
This commit is contained in:
parent
bb7d36d751
commit
d07019f539
@ -466,14 +466,15 @@ func (ar artifactRoutes) downloadArtifact(ctx *ArtifactContext) {
|
|||||||
log.Error("Error getting artifact: %v", err)
|
log.Error("Error getting artifact: %v", err)
|
||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||||
return
|
return
|
||||||
} else if !exist {
|
}
|
||||||
|
if !exist {
|
||||||
log.Error("artifact with ID %d does not exist", artifactID)
|
log.Error("artifact with ID %d does not exist", artifactID)
|
||||||
ctx.Error(http.StatusNotFound, fmt.Sprintf("artifact with ID %d does not exist", artifactID))
|
ctx.Error(http.StatusNotFound, fmt.Sprintf("artifact with ID %d does not exist", artifactID))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if artifact.RunID != runID {
|
if artifact.RunID != runID {
|
||||||
log.Error("Error dismatch runID and artifactID, task: %v, artifact: %v", runID, artifactID)
|
log.Error("Error mismatch runID and artifactID, task: %v, artifact: %v", runID, artifactID)
|
||||||
ctx.Error(http.StatusBadRequest, err.Error())
|
ctx.Error(http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ func getRunJobs(ctx *context_module.Context, runIndex, jobIndex int64) (*actions
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
if len(jobs) == 0 {
|
if len(jobs) == 0 {
|
||||||
ctx.Error(http.StatusNotFound, err.Error())
|
ctx.Error(http.StatusNotFound)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user