log errors only when an error happens (#2029)

This commit is contained in:
Jeff Wendling 2019-05-23 17:20:01 +00:00 committed by GitHub
parent 47a2f5e8b6
commit b0ca12e31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,20 +75,21 @@ func rootMutation(log *zap.Logger, service *console.Service, mailService *mailse
secret, err := console.RegistrationSecretFromBase64(secretInput)
if err != nil {
log.Error("register: failed to parse secret",
zap.String("rawSecret", secretInput),
zap.Error(err))
return nil, err
}
log.Error("register: failed to parse secret",
zap.String("rawSecret", secretInput),
zap.Error(err))
user, err := service.CreateUser(p.Context, createUser, secret)
if err != nil {
log.Error("register: failed to create account",
zap.String("rawSecret", secretInput),
zap.Error(err))
return nil, err
}
log.Error("register: failed to create account",
zap.String("rawSecret", secretInput),
zap.Error(err))
token, err := service.GenerateActivationToken(p.Context, user.ID, user.Email)
if err != nil {