1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 00:38:36 +00:00

Refactor error system (#33626)

This commit is contained in:
wxiaoguang
2025-02-18 04:41:03 +08:00
committed by GitHub
parent 7df09e31fa
commit 15e020eec8
75 changed files with 703 additions and 693 deletions

View File

@@ -83,7 +83,7 @@ func ApplyDiffPatch(ctx *context.APIContext) {
}
if !canWriteFiles(ctx, apiOpts.BranchName) {
ctx.APIError(http.StatusInternalServerError, repo_model.ErrUserDoesNotHaveAccessToRepo{
ctx.APIErrorInternal(repo_model.ErrUserDoesNotHaveAccessToRepo{
UserID: ctx.Doer.ID,
RepoName: ctx.Repo.Repository.LowerName,
})
@@ -105,7 +105,7 @@ func ApplyDiffPatch(ctx *context.APIContext) {
ctx.APIError(http.StatusNotFound, err)
return
}
ctx.APIError(http.StatusInternalServerError, err)
ctx.APIErrorInternal(err)
} else {
ctx.JSON(http.StatusCreated, fileResponse)
}