Browse Source

When delete tracked time through the API return 404 not 500 (#11319) (#11326)

tags/v1.11.5
6543 4 years ago
parent
commit
79868d7096
No account linked to committer's email address
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      routers/api/v1/repo/issue_tracked_time.go

+ 5
- 1
routers/api/v1/repo/issue_tracked_time.go View File

@@ -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
}


Loading…
Cancel
Save