diff options
author | 6543 <6543@obermui.de> | 2020-05-07 19:54:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 18:54:33 +0100 |
commit | 486e4c8087746ca91c05a693cadd563ac061a913 (patch) | |
tree | b87797ad3bba6770d2e122687e3f8464fda0a9af /routers/api/v1 | |
parent | 71e73db2ff1a1599391da22732ad30895d837ba0 (diff) | |
download | gitea-486e4c8087746ca91c05a693cadd563ac061a913.tar.gz gitea-486e4c8087746ca91c05a693cadd563ac061a913.zip |
When deleting a tracked time through the API return 404 not 500 (#11319)
Diffstat (limited to 'routers/api/v1')
-rw-r--r-- | routers/api/v1/repo/issue_tracked_time.go | 4 |
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 } |