ocket8888 commented on a change in pull request #4532: fixed nil exception in
cert autorenewal
URL: https://github.com/apache/trafficcontrol/pull/4532#discussion_r396799309
##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/autorenewcerts.go
##########
@@ -190,8 +190,12 @@ func RunAutorenewal(existingCerts []ExistingCerts, cfg
*config.Config, ctx conte
if cfg.SMTP.Enabled && cfg.ConfigLetsEncrypt.SendExpEmail {
errCode, userErr, sysErr := AlertExpiringCerts(keysFound, *cfg)
- if userErr != nil || sysErr != nil {
- log.Errorf("cert autorenewal: sending email: errCode:
%d userErr: %s sysErr: %s", errCode, userErr.Error(), sysErr.Error())
Review comment:
you could instead just change the format options for errors to `%v` and get
rid of the method call to `error.Error`:
```go
log.Errorf("cert autorenewal: sending email: errCode: %d userErr: %v sysErr:
%v", errCode, userErr, sysErr)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services