polish the error handler

Signed-off-by: Dong Gang <dong.gang@daocloud.io>
pull/8438/head
Dong Gang 4 years ago
parent 3ee7047827
commit df4708a9de

@ -20,6 +20,7 @@ import (
"fmt"
"strings"
"github.com/pkg/errors"
"k8s.io/cli-runtime/pkg/printers"
"sigs.k8s.io/yaml"
@ -92,7 +93,7 @@ func (s *Show) Run(chartpath string) (string, error) {
if s.JSONPathTemplate != "" {
printer, err := printers.NewJSONPathPrinter(s.JSONPathTemplate)
if err != nil {
return "", fmt.Errorf("error parsing jsonpath %s, %v", s.JSONPathTemplate, err)
return "", errors.Wrapf(err, "error parsing jsonpath %s", s.JSONPathTemplate)
}
printer.Execute(&out, s.chart.Values)
} else {

Loading…
Cancel
Save