tolerate nil error in HandleError

This commit is contained in:
deads2k 2016-05-11 09:06:53 -04:00
parent 13f60ea862
commit b2d8c2865a

View File

@ -67,6 +67,11 @@ var ErrorHandlers = []func(error){logError}
// is preferable to logging the error - the default behavior is to log but the
// errors may be sent to a remote server for analysis.
func HandleError(err error) {
// this is sometimes called with a nil error. We probably shouldn't fail and should do nothing instead
if err == nil {
return
}
for _, fn := range ErrorHandlers {
fn(err)
}