~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/bundlechanges/cmd/get-bundle-changes/main.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
                defer r.Close()
33
33
        }
34
34
        if err := process(r, os.Stdout); err != nil {
35
 
                fmt.Fprintf(os.Stderr, "unable to parse bundle: %s\n", err)
 
35
                if verr, ok := err.(*charm.VerificationError); ok {
 
36
                        fmt.Fprintf(os.Stderr, "the given bundle is not valid:\n")
 
37
                        for _, err := range verr.Errors {
 
38
                                fmt.Fprintf(os.Stderr, "%s\n", err)
 
39
                        }
 
40
                } else {
 
41
                        fmt.Fprintf(os.Stderr, "unable to parse bundle: %s\n", err)
 
42
                }
36
43
                os.Exit(1)
37
44
        }
38
45
}