Skip to content

Commit

Permalink
fix: pick up possible exceptions from create method
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Golovin <[email protected]>
  • Loading branch information
dgolovin authored and benoitf committed Aug 16, 2023
1 parent 9bf508e commit 0cabb65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/main/src/plugin/provider-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,20 +706,21 @@ export class ProviderRegistry {
const provider = this.getMatchingProvider(internalProviderId);
const telemetryData: {
providerId: string;
error?: Error;
error?: unknown;
name: string;
} = {
providerId: provider.id,
name: provider.name,
};
try {
if (!provider.containerProviderConnectionFactory) {
const error = new Error('The provider does not support container connection creation');
telemetryData.error = error;
throw error;
throw new Error('The provider does not support container connection creation');
}
// create a logger
return provider.containerProviderConnectionFactory.create(params, logHandler, token);
} catch (err) {
telemetryData.error = err;
throw err;
} finally {
await this.telemetryService.track('createProviderConnection', telemetryData);
}
Expand Down

0 comments on commit 0cabb65

Please sign in to comment.