Skip to content

Commit

Permalink
Handle failure to check for dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Feb 19, 2025
1 parent 2122937 commit 2bfb463
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,20 @@ export const CreateConnection = (props: PropsWithChildren<CreateConnectionProps>
}

if (props.selectedDriver.checkDependencies && props.selectedDriver.installDependencies) {
const dependenciesInstalled = await props.selectedDriver.checkDependencies();
let dependenciesInstalled = false;
try {
dependenciesInstalled = await props.selectedDriver.checkDependencies();
} catch (err) {
services.notificationService.error(localize(
'positron.newConnectionModalDialog.createConnection.failedToCheckDependencies',
'Failed to check if dependencies are installed: {}',
err
));
// If we fail to check if dependencies are installed, we presume they are installed
// and let the user try to connect anyway so they don't get blocked.
dependenciesInstalled = true;
}

if (!dependenciesInstalled) {
await props.selectedDriver.installDependencies();
}
Expand Down

0 comments on commit 2bfb463

Please sign in to comment.