Skip to content

Commit b1c7c43

Browse files
committed
add logging for database connection
1 parent df7a7b0 commit b1c7c43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

e2e/logic/pom/homePage.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,13 @@ export class HomePage extends BasePage {
11131113
// No database exists, connect to test database
11141114
const { postgres: postgresUrl } = getTestDatabases();
11151115
const response = await apiCall.connectDatabase(postgresUrl);
1116-
await apiCall.parseStreamingResponse(response);
1116+
const messages = await apiCall.parseStreamingResponse(response);
1117+
1118+
// Check if connection was successful
1119+
const finalMessage = messages[messages.length - 1];
1120+
if (finalMessage.type === 'error' || !finalMessage.success) {
1121+
throw new Error(`Database connection failed: ${finalMessage.message || 'Unknown error'}`);
1122+
}
11171123

11181124
// Refresh the page so the frontend can fetch the updated database list
11191125
await this.page.reload();

0 commit comments

Comments
 (0)