Skip to content

Commit 464792d

Browse files
committed
Improve task provider robustness to errors
1 parent a572153 commit 464792d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: integration/vscode/ada/src/taskProviders.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,19 @@ export class SimpleTaskProvider implements vscode.TaskProvider {
534534
/**
535535
* If a test harness project exists, provide a task to build it.
536536
*/
537-
const harnessPrj = await getGnatTestDriverProjectPath();
538-
if (existsSync(harnessPrj)) {
537+
const harnessPrj = await getGnatTestDriverProjectPath().catch(
538+
/**
539+
* In case of errors fallback silently to keep providing tasks
540+
* even in case of errors.
541+
*/
542+
(reason) => {
543+
logger.error(
544+
'Error while querying for the GNATtest test driver project\n' + reason,
545+
);
546+
return undefined;
547+
},
548+
);
549+
if (harnessPrj && existsSync(harnessPrj)) {
539550
taskDeclsToOffer.push({
540551
label: TASK_BUILD_TEST_DRIVER,
541552
taskDef: {

0 commit comments

Comments
 (0)