Skip to content

Commit

Permalink
Merge pull request juju#18 from frankban/better-cmd-output
Browse files Browse the repository at this point in the history
get-bundle-changes: print all errors when the given bundle is not valid.
  • Loading branch information
jujugui committed Mar 11, 2016
2 parents 2618de2 + 17dc477 commit a59f55d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/get-bundle-changes/main.go
Expand Up @@ -32,7 +32,14 @@ func main() {
defer r.Close()
}
if err := process(r, os.Stdout); err != nil {
fmt.Fprintf(os.Stderr, "unable to parse bundle: %s\n", err)
if verr, ok := err.(*charm.VerificationError); ok {
fmt.Fprintf(os.Stderr, "the given bundle is not valid:\n")
for _, err := range verr.Errors {
fmt.Fprintf(os.Stderr, "%s\n", err)
}
} else {
fmt.Fprintf(os.Stderr, "unable to parse bundle: %s\n", err)
}
os.Exit(1)
}
}
Expand Down

0 comments on commit a59f55d

Please sign in to comment.