File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments