Skip to content

Commit

Permalink
Merge pull request #152 from Arkanayan/user/arka/runcommand-error-type
Browse files Browse the repository at this point in the history
Add RunCommandFailed error code
  • Loading branch information
Arkanayan committed Mar 1, 2023
2 parents 1c1b947 + 7bf9c09 commit 07efba3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ func GetErrorCode(err error) string {
return "Invalid Type"
} else if wmi.IsWMIError(err) {
return err.Error()
} else if IsRunCommandFailed(err) {
return "RunCommandFailed"
}

return "GenericError"
Expand Down Expand Up @@ -295,6 +297,10 @@ func IsErrDeadlineExceeded(err error) bool {
return checkError(err, os.ErrDeadlineExceeded)
}

func IsRunCommandFailed(err error) bool {
return checkError(err, RunCommandFailed)
}

func checkError(wrappedError, err error) bool {
if wrappedError == nil {
return false
Expand Down

0 comments on commit 07efba3

Please sign in to comment.