diff --git a/server/forge/gitea/gitea.go b/server/forge/gitea/gitea.go index 13ba41693..501de1572 100644 --- a/server/forge/gitea/gitea.go +++ b/server/forge/gitea/gitea.go @@ -21,6 +21,7 @@ package gitea import ( "context" "crypto/tls" + "errors" "fmt" "net" "net/http" @@ -548,11 +549,8 @@ func (c *Gitea) Org(ctx context.Context, u *model.User, owner string) (*model.Or return nil, err } - org, _, err := client.GetOrg(owner) - if err != nil { - return nil, err - } - if org != nil { + org, _, orgErr := client.GetOrg(owner) + if orgErr == nil && org != nil { return &model.Org{ Name: org.UserName, Private: gitea.VisibleType(org.Visibility) != gitea.VisibleTypePublic, @@ -561,6 +559,9 @@ func (c *Gitea) Org(ctx context.Context, u *model.User, owner string) (*model.Or user, _, err := client.GetUserInfo(owner) if err != nil { + if orgErr != nil { + err = errors.Join(orgErr, err) + } return nil, err } return &model.Org{