Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion cli/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,20 @@ func mergeResultMessages(results []schema.DeployResult) string {
}
}

return strings.Join(okMessages, "\n") + "\n\n" + strings.Join(errMessages, "\n")
output := ""

if len(okMessages) > 0 {
output += strings.Join(okMessages, "\n")
if len(errMessages) > 0 {
output += "\n\n"
}
}

if len(errMessages) > 0 {
output += strings.Join(errMessages, "\n")
}

return output
}

func didAllResultsError(results []schema.DeployResult) bool {
Expand Down
6 changes: 3 additions & 3 deletions pkg/lib/errors/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ import (
)

func PrintError(err error, strs ...string) {
fmt.Println(errorStr(err, strs...))
fmt.Println(ErrorStr(err, strs...))
// PrintStacktrace(err)
}

func PrintErrorForUser(err error, strs ...string) {
print.BoldFirstLine(errorStr(err, strs...))
print.BoldFirstLine(ErrorStr(err, strs...))
// PrintStacktrace(err)
}

func errorStr(err error, strs ...string) string {
func ErrorStr(err error, strs ...string) string {
wrappedErr := Wrap(err, strs...)
return "error: " + strings.TrimSpace(Message(wrappedErr))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func Deploy(projectBytes []byte, configFileName string, configBytes []byte, forc
api, msg, err := UpdateAPI(&apiConfig, projectID, force)
results[i].Message = msg
if err != nil {
results[i].Error = errors.Message(err)
results[i].Error = errors.ErrorStr(err)
} else {
results[i].API = api
}
Expand Down