Skip to content

Commit 9f11546

Browse files
6543Yohann Delafollye
authored andcommitted
When deleting a tracked time through the API return 404 not 500 (go-gitea#11319)
1 parent b666aaa commit 9f11546

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

routers/api/v1/repo/issue_tracked_time.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ func DeleteTime(ctx *context.APIContext) {
317317

318318
time, err := models.GetTrackedTimeByID(ctx.ParamsInt64(":id"))
319319
if err != nil {
320+
if models.IsErrNotExist(err) {
321+
ctx.NotFound(err)
322+
return
323+
}
320324
ctx.Error(http.StatusInternalServerError, "GetTrackedTimeByID", err)
321325
return
322326
}

0 commit comments

Comments
 (0)