mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Merge pull request #25472 from deads2k/tolerate-nil-error
tolerate nil error in HandleError
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user