Skip to content

Commit

Permalink
Merge pull request #74 from janetkuo/error-output
Browse files Browse the repository at this point in the history
Correctly log error
  • Loading branch information
janetkuo authored Aug 3, 2016
2 parents 72fc1a2 + 1acaf3c commit c6d137f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cli/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,12 +738,12 @@ func loadBundlesFile(file string, opt convertOptions) KomposeObject {
}
buf, err := ioutil.ReadFile(file)
if err != nil {
logrus.Fatalf("Failed to read bundles file: ", err)
logrus.Fatalf("Failed to read bundles file: %v", err)
}
reader := strings.NewReader(string(buf))
bundle, err := bundlefile.LoadFile(reader)
if err != nil {
logrus.Fatalf("Failed to parse bundles file: ", err)
logrus.Fatalf("Failed to parse bundles file: %v", err)
}

for name, service := range bundle.Services {
Expand All @@ -757,19 +757,19 @@ func loadBundlesFile(file string, opt convertOptions) KomposeObject {

image, err := loadImage(service)
if err != "" {
logrus.Fatalf("Failed to load image from bundles file: " + err)
logrus.Fatalf("Failed to load image from bundles file: %v", err)
}
serviceConfig.Image = image

envs, err := loadEnvVars(service)
if err != "" {
logrus.Fatalf("Failed to load envvar from bundles file: " + err)
logrus.Fatalf("Failed to load envvar from bundles file: %v", err)
}
serviceConfig.Environment = envs

ports, err := loadPorts(service)
if err != "" {
logrus.Fatalf("Failed to load ports from bundles file: " + err)
logrus.Fatalf("Failed to load ports from bundles file: %v", err)
}
serviceConfig.Port = ports

Expand Down Expand Up @@ -816,7 +816,7 @@ func loadComposeFile(file string, opt convertOptions) KomposeObject {
composeObject := project.NewProject(&context.Context, nil, nil)
err := composeObject.Parse()
if err != nil {
logrus.Fatalf("Failed to load compose file", err)
logrus.Fatalf("Failed to load compose file: %v", err)
}

// transform composeObject into komposeObject
Expand All @@ -837,7 +837,7 @@ func loadComposeFile(file string, opt convertOptions) KomposeObject {
// load ports
ports, err := loadPortsFromCompose(composeServiceConfig.Ports)
if err != "" {
logrus.Fatalf("Failed to load ports from compose file: " + err)
logrus.Fatalf("Failed to load ports from compose file: %v", err)
}
serviceConfig.Port = ports

Expand All @@ -848,7 +848,7 @@ func loadComposeFile(file string, opt convertOptions) KomposeObject {
labels := composeServiceConfig.Labels
if labels != nil {
if err := labels.UnmarshalYAML("", labels); err != nil {
logrus.Fatalf("Failed to load labels from compose file: ", err)
logrus.Fatalf("Failed to load labels from compose file: %v", err)
}
}
serviceConfig.Labels = labels
Expand Down Expand Up @@ -1044,7 +1044,7 @@ func komposeConvert(komposeObject KomposeObject, opt convertOptions) {
if opt.createChart {
err := generateHelm(opt.inputFile, svcnames, opt.generateYaml, opt.createD, opt.createDS, opt.createRC, opt.outFile)
if err != nil {
logrus.Fatalf("Failed to create Chart data: %s\n", err)
logrus.Fatalf("Failed to create Chart data: %v", err)
}
}

Expand Down

0 comments on commit c6d137f

Please sign in to comment.