Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve db open error cases #370

Merged
merged 1 commit into from
Mar 16, 2023
Merged
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
6 changes: 5 additions & 1 deletion cmd/db_open.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (c *DBOpenCommand) Run(args []string) int {

if err := dumpDbCredentials.Run(); err != nil {
c.UI.Error("Error opening database. Temporary playbook failed to execute:")
c.UI.Error(mockUi.OutputWriter.String())
c.UI.Error(mockUi.ErrorWriter.String())
return 1
}
Expand All @@ -145,7 +146,10 @@ func (c *DBOpenCommand) Run(args []string) int {
var dbCredentials DBCredentials
unmarshalErr := json.Unmarshal(dbCredentialsByte, &dbCredentials)
if unmarshalErr != nil {
c.UI.Error(fmt.Sprintf("Error unmarshaling db credentials JSON file: %s", unmarshalErr))
c.UI.Error(fmt.Sprintf("Error parsing db credentials JSON file: %s", unmarshalErr))
c.UI.Error("This probably means the temporary playbook used to template out the JSON file with database credentials failed. Here was the output for troubleshooting:")
c.UI.Error(mockUi.OutputWriter.String())
c.UI.Error(mockUi.ErrorWriter.String())
return 1
}

Expand Down