diff options
Diffstat (limited to 'routers/api/v1/user/app.go')
-rw-r--r-- | routers/api/v1/user/app.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/user/app.go b/routers/api/v1/user/app.go index 33b27d60e0..b88ed6fbd2 100644 --- a/routers/api/v1/user/app.go +++ b/routers/api/v1/user/app.go @@ -274,7 +274,11 @@ func DeleteOauth2Application(ctx *context.APIContext) { // "$ref": "#/responses/empty" appID := ctx.ParamsInt64(":id") if err := models.DeleteOAuth2Application(appID, ctx.User.ID); err != nil { - ctx.Error(http.StatusInternalServerError, "DeleteOauth2ApplicationByID", err) + if models.IsErrOAuthApplicationNotFound(err) { + ctx.NotFound() + } else { + ctx.Error(http.StatusInternalServerError, "DeleteOauth2ApplicationByID", err) + } return } |