1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

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
This commit is contained in:
Morgan Bazalgette 2018-03-04 03:45:01 +01:00 committed by Lunny Xiao
parent 78b54b49fa
commit b730498f02

View file

@ -374,7 +374,11 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
//Find Committer account //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 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 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{ return &CommitVerification{
Verified: false, Verified: false,
Reason: "gpg.error.no_committer_account", Reason: "gpg.error.no_committer_account",