From: 6543 <6543@obermui.de> Date: Thu, 7 May 2020 19:42:33 +0000 (+0200) Subject: When delete tracked time through the API return 404 not 500 (#11319) (#11326) X-Git-Tag: v1.11.5~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=79868d7096296f2afa4ccdc20cc69efac693b812;p=gitea.git When delete tracked time through the API return 404 not 500 (#11319) (#11326) --- diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index 80830e2fe6..ec49fdbfdf 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -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 }