This commit is contained in:
parent
61214bd33b
commit
83ab2b8bb5
|
|
@ -28,7 +28,7 @@ func getExitCode(err error) (int, error) {
|
||||||
// If it is not an *exec.ExitError, then it must be
|
// If it is not an *exec.ExitError, then it must be
|
||||||
// an io error, but docs do not say anything about the
|
// an io error, but docs do not say anything about the
|
||||||
// exit code in this case.
|
// exit code in this case.
|
||||||
return 0, errors.New("expected *exec.ExitError")
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ws, ok := ee.Sys().(syscall.WaitStatus)
|
ws, ok := ee.Sys().(syscall.WaitStatus)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ func TestGetExitCode(t *testing.T) {
|
||||||
return errors.New("I am not *exec.ExitError")
|
return errors.New("I am not *exec.ExitError")
|
||||||
},
|
},
|
||||||
expCode: 0,
|
expCode: 0,
|
||||||
expErr: errors.New("expected *exec.ExitError"),
|
expErr: errors.New("I am not *exec.ExitError"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,7 +177,7 @@ func TestTryAddState(t *testing.T) {
|
||||||
n("nagios").
|
n("nagios").
|
||||||
f("perfdata", 0).b(),
|
f("perfdata", 0).b(),
|
||||||
}
|
}
|
||||||
expErr := "exec: get exit code: expected *exec.ExitError"
|
expErr := "exec: get exit code: non parsable error"
|
||||||
|
|
||||||
assertEqual(t, exp, metrics)
|
assertEqual(t, exp, metrics)
|
||||||
require.Equal(t, expErr, err.Error())
|
require.Equal(t, expErr, err.Error())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue