Skip to content

Commit b730498

Browse files
thehowllunny
authored andcommitted
Don't write to log NoCommitterAccount (#3621)
* 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
1 parent 78b54b4 commit b730498

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

models/gpg_key.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,11 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
374374
//Find Committer account
375375
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
376376
if err != nil { //Skipping not user for commiter
377-
log.Error(3, "NoCommitterAccount: %v", err)
377+
// We can expect this to often be an ErrUserNotExist. in the case
378+
// it is not, however, it is important to log it.
379+
if !IsErrUserNotExist(err) {
380+
log.Error(3, "GetUserByEmail: %v", err)
381+
}
378382
return &CommitVerification{
379383
Verified: false,
380384
Reason: "gpg.error.no_committer_account",

0 commit comments

Comments
 (0)