1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 00:54:28 +00:00

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

This commit is contained in:
6543 2020-05-07 19:54:33 +02:00 committed by GitHub
parent 71e73db2ff
commit 486e4c8087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}