diff options
author | skyblue <ssx205@gmail.com> | 2014-04-09 00:31:09 +0800 |
---|---|---|
committer | skyblue <ssx205@gmail.com> | 2014-04-09 00:31:09 +0800 |
commit | 24d0ca4aa02bd4245cd4c91f71b918c5da1d2e7d (patch) | |
tree | f0cd796a0ca0ceb6a5d37204a1711d527384d35d | |
parent | d4565483e67dfd17f723114d5849b2ce6895c077 (diff) | |
download | gitea-24d0ca4aa02bd4245cd4c91f71b918c5da1d2e7d.tar.gz gitea-24d0ca4aa02bd4245cd4c91f71b918c5da1d2e7d.zip |
clean tail
-rw-r--r-- | models/oauth2.go | 8 | ||||
-rw-r--r-- | routers/user/social.go | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/models/oauth2.go b/models/oauth2.go index 10771d6a73..4da9800670 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -1,9 +1,6 @@ package models -import ( - "errors" - "fmt" -) +import "errors" // OT: Oauth2 Type const ( @@ -41,8 +38,7 @@ func GetOauth2(identity string) (oa *Oauth2, err error) { return } if !exists { - err = fmt.Errorf("not exists oauth2: %s", identity) - return + return nil, ErrOauth2RecordNotExists } if oa.Uid == 0 { return oa, ErrOauth2NotAssociatedWithUser diff --git a/routers/user/social.go b/routers/user/social.go index b47a4c1cef..7b4d232987 100644 --- a/routers/user/social.go +++ b/routers/user/social.go @@ -109,6 +109,9 @@ func SocialSignIn(ctx *middleware.Context, tokens oauth2.Tokens) { } case models.ErrOauth2NotAssociatedWithUser: // pass + default: + log.Error(err) // FIXME: handle error page + return } ctx.Session.Set("socialId", oa.Id) log.Info("socialId: %v", oa.Id) |