Skip to content

Commit 0996b3b

Browse files
authored
Merge pull request #612 from adamancini/sc-51130/postgres-analyzer
include the db connection error message with the outcome
2 parents c9c3055 + b617de3 commit 0996b3b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/analyze/postgres.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ func analyzePostgres(analyzer *troubleshootv1beta2.DatabaseAnalyze, getCollected
3939
IconURI: "https://troubleshoot.sh/images/analyzer-icons/postgres-analyze.svg",
4040
}
4141

42-
if databaseConnection.Error != "" {
43-
result.IsFail = true
44-
result.Message = databaseConnection.Error
45-
return result, nil
46-
}
47-
4842
for _, outcome := range analyzer.Outcomes {
4943
if outcome.Fail != nil {
5044
if outcome.Fail.When == "" {
@@ -61,8 +55,14 @@ func analyzePostgres(analyzer *troubleshootv1beta2.DatabaseAnalyze, getCollected
6155
}
6256

6357
if isMatch {
58+
59+
if databaseConnection.Error != "" {
60+
result.Message = outcome.Fail.Message + " " + databaseConnection.Error
61+
} else {
62+
result.Message = outcome.Fail.Message
63+
}
64+
6465
result.IsFail = true
65-
result.Message = outcome.Fail.Message
6666
result.URI = outcome.Fail.URI
6767

6868
return result, nil

0 commit comments

Comments
 (0)