Skip to content

Commit

Permalink
When deleting a tracked time through the API return 404 not 500 (go-g…
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored May 7, 2020
1 parent 71e73db commit 486e4c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routers/api/v1/repo/issue_tracked_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 486e4c8

Please sign in to comment.