Skip to content

Commit

Permalink
Don't write to log NoCommitterAccount (#3621)
Browse files Browse the repository at this point in the history
* Don't write to log NoCommitterAccount

It's way too verbose, and the information is also printed to the user
already. Fixes #3602.

* ignore err only if it's a ErrUserNotExist

* Replace with IsErrUserNotExist
  • Loading branch information
thehowl authored and lunny committed Mar 4, 2018
1 parent 78b54b4 commit b730498
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/gpg_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
//Find Committer account
committer, err := GetUserByEmail(c.Committer.Email) //This find the user by primary email or activated email so commit will not be valid if email is not
if err != nil { //Skipping not user for commiter
log.Error(3, "NoCommitterAccount: %v", err)
// We can expect this to often be an ErrUserNotExist. in the case
// it is not, however, it is important to log it.
if !IsErrUserNotExist(err) {
log.Error(3, "GetUserByEmail: %v", err)
}
return &CommitVerification{
Verified: false,
Reason: "gpg.error.no_committer_account",
Expand Down

0 comments on commit b730498

Please sign in to comment.