1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 17:17:19 +00:00

When delete tracked time through the API return 404 not 500 (#11319) (#11326)

This commit is contained in:
6543
2020-05-07 21:42:33 +02:00
committed by GitHub
parent 19626b93f8
commit 79868d7096

View File

@ -289,7 +289,11 @@ func DeleteTime(ctx *context.APIContext) {
time, err := models.GetTrackedTimeByID(ctx.ParamsInt64(":id"))
if err != nil {
ctx.Error(500, "GetTrackedTimeByID", err)
if models.IsErrNotExist(err) {
ctx.NotFound(err)
return
}
ctx.Error(http.StatusInternalServerError, "GetTrackedTimeByID", err)
return
}