testing exit codes
This commit is contained in:
parent
f9f879e7ee
commit
3a9d03a46f
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,7 @@ func (cmd *LinuxCommand) Run() error {
|
||||||
if err := command.Start(); err != nil {
|
if err := command.Start(); err != nil {
|
||||||
var exitErr *exec.ExitError
|
var exitErr *exec.ExitError
|
||||||
if errors.As(err, &exitErr) {
|
if errors.As(err, &exitErr) {
|
||||||
|
fmt.Println(exitErr.ExitCode())
|
||||||
if exitErr.ExitCode() == 127 {
|
if exitErr.ExitCode() == 127 {
|
||||||
return ErrCommandNotFound
|
return ErrCommandNotFound
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,6 +52,7 @@ func (cmd *LinuxCommand) Run() error {
|
||||||
if err := command.Start(); err != nil {
|
if err := command.Start(); err != nil {
|
||||||
var exitErr *exec.ExitError
|
var exitErr *exec.ExitError
|
||||||
if errors.As(err, &exitErr) {
|
if errors.As(err, &exitErr) {
|
||||||
|
fmt.Println(exitErr.ExitCode())
|
||||||
if exitErr.ExitCode() == 127 {
|
if exitErr.ExitCode() == 127 {
|
||||||
return ErrCommandNotFound
|
return ErrCommandNotFound
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue