summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/fork.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-07-06 15:30:19 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-07-06 21:30:19 +0800
commit30787e48f219b23701f660ba0b99b326ab82e997 (patch)
tree005dfef495149e81e78ad31c251cc3a3e2709870 /routers/api/v1/repo/fork.go
parent2ef33b53381f68dc2af88eabfe5f35c3dbc94412 (diff)
downloadgitea-30787e48f219b23701f660ba0b99b326ab82e997.tar.gz
gitea-30787e48f219b23701f660ba0b99b326ab82e997.zip
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
Diffstat (limited to 'routers/api/v1/repo/fork.go')
-rw-r--r--routers/api/v1/repo/fork.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go
index c743aec301..44b79a6fef 100644
--- a/routers/api/v1/repo/fork.go
+++ b/routers/api/v1/repo/fork.go
@@ -59,7 +59,7 @@ func CreateFork(ctx *context.APIContext, form api.CreateForkOption) {
} else {
org, err := models.GetOrgByName(*form.Organization)
if err != nil {
- if err == models.ErrOrgNotExist {
+ if models.IsErrOrgNotExist(err) {
ctx.Error(422, "", err)
} else {
ctx.Error(500, "GetOrgByName", err)