mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-17 19:32:40 +00:00
Backport #37572 by @Exgene ## Issue Closes #37217 The error string was getting lost while returning due to `ctx.JSON()` which cannot serialize the `error` object. ## Fix Use `ctx.APIError()` to return proper error messages back to the client. Co-authored-by: Kausthubh J Rao <105716675+Exgene@users.noreply.github.com>
This commit is contained in:
@@ -994,7 +994,7 @@ func MergePullRequest(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
if strings.Contains(err.Error(), "Wrong commit ID") {
|
||||
ctx.JSON(http.StatusConflict, err)
|
||||
ctx.APIError(http.StatusConflict, err)
|
||||
return
|
||||
}
|
||||
ctx.APIErrorInternal(err)
|
||||
|
||||
Reference in New Issue
Block a user