Skip to content

Commit 8682997

Browse files
authored
Merge pull request #40 from packethost/log-skip-nil-errors
log: Return from Error if err is nil
2 parents 8e2e62d + 71fd238 commit 8682997

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

log/log.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ func (l Logger) Close() {
103103
// All the values of arg are stringified and concatenated without any strings.
104104
// If no args are provided err.Error() is used as the log message.
105105
func (l Logger) Error(err error, args ...interface{}) {
106+
if err == nil {
107+
return
108+
}
106109
if ok := os.Getenv("ROLLBAR_TOKEN"); ok != "" {
107110
rollbar.Notify(err, args)
108111
}

0 commit comments

Comments
 (0)