Skip to content

Commit 0993f6e

Browse files
authored
Merge pull request #109 from replicatedhq/divolgin/show-errors
include errors in messages on failures
2 parents 46cebad + 89250b0 commit 0993f6e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

cmd/preflight/cli/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func runPreflights(v *viper.Viper, arg string) error {
6060

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

6666
s := spin.New()

cmd/troubleshoot/cli/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
6060

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

6666
s := spin.New()

pkg/analyze/common_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func compareActualToWhen(when string, actual int) (bool, error) {
9494

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

100100
switch parts[0] {

pkg/analyze/container_runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func compareRuntimeConditionalToActual(conditional string, actual string) (bool,
117117

118118
parsedRuntime, err := url.Parse(actual)
119119
if err != nil {
120-
return false, errors.New("unable to parse url")
120+
return false, errors.Wrap(err, "failed to parse url")
121121
}
122122

123123
switch parts[0] {

0 commit comments

Comments
 (0)