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

pull/11325/head
6543 5 years ago committed by GitHub
parent 19626b93f8
commit 79868d7096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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