summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-05-07 19:54:33 +0200
committerGitHub <noreply@github.com>2020-05-07 18:54:33 +0100
commit486e4c8087746ca91c05a693cadd563ac061a913 (patch)
treeb87797ad3bba6770d2e122687e3f8464fda0a9af /routers/api
parent71e73db2ff1a1599391da22732ad30895d837ba0 (diff)
downloadgitea-486e4c8087746ca91c05a693cadd563ac061a913.tar.gz
gitea-486e4c8087746ca91c05a693cadd563ac061a913.zip
When deleting a tracked time through the API return 404 not 500 (#11319)
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/issue_tracked_time.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go
index 9bad19a2e7..66f8a0879a 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
}