Skip to content

Commit 22d397c

Browse files
authored
Merge pull request #190 from MikaelSmith/error-on-connect-fail
Report errors connecting to the database
2 parents 428db22 + 4b9680b commit 22d397c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/analyze/postgres.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ func analyzePostgres(analyzer *troubleshootv1beta1.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+
4248
for _, outcome := range analyzer.Outcomes {
4349
if outcome.Fail != nil {
4450
if outcome.Fail.When == "" {

0 commit comments

Comments
 (0)