properly handle error
This commit is contained in:
parent
be8fd4ca55
commit
368b99ecfa
2 changed files with 3 additions and 3 deletions
|
@ -54,7 +54,7 @@ func (cmd *LinuxCommand) Run() error {
|
||||||
if exitErr.ExitCode() == 127 {
|
if exitErr.ExitCode() == 127 {
|
||||||
return ErrCommandNotFound
|
return ErrCommandNotFound
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("%w: %w", ErrRunningCmd, err)
|
return fmt.Errorf("%s: %w", ErrRunningCmd.Error(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ func (cmd *LinuxCommand) Run() error {
|
||||||
if exitErr.ExitCode() == 127 {
|
if exitErr.ExitCode() == 127 {
|
||||||
return ErrCommandNotFound
|
return ErrCommandNotFound
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("%w: %w", ErrRunningCmd, err)
|
return fmt.Errorf("%s: %w", ErrRunningCmd.Error(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package shell
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
Loading…
Reference in a new issue