Skip to content

Commit

Permalink
Merge pull request #109 from replicatedhq/divolgin/show-errors
Browse files Browse the repository at this point in the history
include errors in messages on failures
  • Loading branch information
divolgin authored Dec 26, 2019
2 parents 46cebad + 89250b0 commit 0993f6e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/preflight/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func runPreflights(v *viper.Viper, arg string) error {

preflight := troubleshootv1beta1.Preflight{}
if err := yaml.Unmarshal([]byte(preflightContent), &preflight); err != nil {
return fmt.Errorf("unable to parse %s as a preflight", arg)
return errors.Wrapf(err, "failed to parse %s as a preflight", arg)
}

s := spin.New()
Expand Down
2 changes: 1 addition & 1 deletion cmd/troubleshoot/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {

collector := troubleshootv1beta1.Collector{}
if err := yaml.Unmarshal([]byte(collectorContent), &collector); err != nil {
return fmt.Errorf("unable to parse %s collectors", arg)
return errors.Wrapf(err, "failed to parse %s collectors", arg)
}

s := spin.New()
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyze/common_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func compareActualToWhen(when string, actual int) (bool, error) {

value, err := strconv.Atoi(parts[1])
if err != nil {
return false, errors.New("unable to parse when value")
return false, errors.Wrap(err, "failed to parse when value")
}

switch parts[0] {
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyze/container_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func compareRuntimeConditionalToActual(conditional string, actual string) (bool,

parsedRuntime, err := url.Parse(actual)
if err != nil {
return false, errors.New("unable to parse url")
return false, errors.Wrap(err, "failed to parse url")
}

switch parts[0] {
Expand Down

0 comments on commit 0993f6e

Please sign in to comment.