Browse Source

When deleting a tracked time through the API return 404 not 500 (#11319)

for-closed-social
6543 4 years ago
committed by GitHub
parent
commit
486e4c8087
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      routers/api/v1/repo/issue_tracked_time.go

+ 4
- 0
routers/api/v1/repo/issue_tracked_time.go View File

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

Loading…
Cancel
Save