Commit 06a893b3 authored by Saad Ali's avatar Saad Ali

Merge pull request #25472 from deads2k/tolerate-nil-error

tolerate nil error in HandleError
parents 55f7bb9c b2d8c286
...@@ -67,6 +67,11 @@ var ErrorHandlers = []func(error){logError} ...@@ -67,6 +67,11 @@ var ErrorHandlers = []func(error){logError}
// is preferable to logging the error - the default behavior is to log but the // is preferable to logging the error - the default behavior is to log but the
// errors may be sent to a remote server for analysis. // errors may be sent to a remote server for analysis.
func HandleError(err error) { 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 { for _, fn := range ErrorHandlers {
fn(err) fn(err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment