mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Improve org error handling (#2117)
* Improve ErrOrgNotExist type Return new error type Use good error check Use new method to check error Update tests * Fix unchanged method name report
This commit is contained in:
committed by
Lunny Xiao
parent
2ef33b5338
commit
30787e48f2
@@ -156,7 +156,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
|
||||
|
||||
org, err := models.GetOrgByName(ctx.Params(":org"))
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
if models.IsErrOrgNotExist(err) {
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.Error(500, "GetOrgByName", err)
|
||||
|
Reference in New Issue
Block a user