Skip to content

Commit a154fa5

Browse files
Copilotsergeibbb
andcommitted
Handle rejected promises in addition to error results
Co-authored-by: sergeibbb <[email protected]>
1 parent b2562f4 commit a154fa5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/plus/integrations/integrationService.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,11 +804,17 @@ export class IntegrationService implements Disposable {
804804
),
805805
];
806806

807-
// Collect errors
807+
// Collect errors from both rejected promises and fulfilled promises with errors
808808
const errors = [
809-
...filterMap(results, r =>
810-
r.status === 'fulfilled' && r.value?.error != null ? r.value.error : undefined,
811-
),
809+
...filterMap(results, r => {
810+
if (r.status === 'rejected') {
811+
return r.reason instanceof Error ? r.reason : new Error(String(r.reason));
812+
}
813+
if (r.status === 'fulfilled' && r.value?.error != null) {
814+
return r.value.error;
815+
}
816+
return undefined;
817+
}),
812818
];
813819

814820
// Return successful results if we have any, even if some integrations failed

0 commit comments

Comments
 (0)