From 486e4c8087746ca91c05a693cadd563ac061a913 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 7 May 2020 19:54:33 +0200 Subject: [PATCH] When deleting a tracked time through the API return 404 not 500 (#11319) --- routers/api/v1/repo/issue_tracked_time.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index 9bad19a2e..66f8a0879 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -317,6 +317,10 @@ func DeleteTime(ctx *context.APIContext) { time, err := models.GetTrackedTimeByID(ctx.ParamsInt64(":id")) if err != nil { + if models.IsErrNotExist(err) { + ctx.NotFound(err) + return + } ctx.Error(http.StatusInternalServerError, "GetTrackedTimeByID", err) return }