Skip to content

Commit 79868d7

Browse files
authored
When delete tracked time through the API return 404 not 500 (go-gitea#11319) (go-gitea#11326)
1 parent 19626b9 commit 79868d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

routers/api/v1/repo/issue_tracked_time.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ func DeleteTime(ctx *context.APIContext) {
289289

290290
time, err := models.GetTrackedTimeByID(ctx.ParamsInt64(":id"))
291291
if err != nil {
292-
ctx.Error(500, "GetTrackedTimeByID", err)
292+
if models.IsErrNotExist(err) {
293+
ctx.NotFound(err)
294+
return
295+
}
296+
ctx.Error(http.StatusInternalServerError, "GetTrackedTimeByID", err)
293297
return
294298
}
295299

0 commit comments

Comments
 (0)