diff options
author | 6543 | 2020-05-07 21:42:33 +0200 |
---|---|---|
committer | GitHub | 2020-05-07 22:42:33 +0300 |
commit | 79868d7096296f2afa4ccdc20cc69efac693b812 (patch) | |
tree | b62fe9dda18252863fa33d76719e49b17ac00683 | |
parent | 19626b93f8d04fd72cf8fc3abb6c53666b44537b (diff) |
When delete tracked time through the API return 404 not 500 (#11319) (#11326)
-rw-r--r-- | routers/api/v1/repo/issue_tracked_time.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index 80830e2fe..ec49fdbfd 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 } |