Skip to content

Commit

Permalink
chore: verify getHostInfoByStrategy behaviour in ConnectionProviderMa…
Browse files Browse the repository at this point in the history
…nager (#271)
  • Loading branch information
sophia-bq authored Nov 1, 2024
1 parent fdb4c1c commit 0159447
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
20 changes: 7 additions & 13 deletions common/lib/connection_provider_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,16 @@ export class ConnectionProviderManager {
if (ConnectionProviderManager.connProvider?.acceptsStrategy(role, strategy)) {
try {
host = ConnectionProviderManager.connProvider.getHostInfoByStrategy(hosts, role, strategy, props);
} catch (error) {
if (error instanceof AwsWrapperError && error.message.includes("Unsupported host selection strategy")) {
// Ignore and try with the default provider.
} else {
throw error;
}
} catch {
// Ignore and try with other providers.
}
} else if (this.effectiveProvider?.acceptsStrategy(role, strategy)) {
}

if (this.effectiveProvider?.acceptsStrategy(role, strategy)) {
try {
host = this.effectiveProvider.getHostInfoByStrategy(hosts, role, strategy, props);
} catch (error) {
if (error instanceof AwsWrapperError && error.message.includes("Unsupported host selection strategy")) {
// Ignore and try with the default provider.
} else {
throw error;
}
} catch {
// Ignore and try with the default provider.
}
}

Expand Down
1 change: 0 additions & 1 deletion common/lib/utils/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"PluginManager.pipelineNone": "A pipeline was requested but the created pipeline evaluated to undefined.",
"PluginManager.unableToRetrievePlugin": "Unable to retrieve plugin instance.",
"ConnectionProvider.unsupportedHostSelectorStrategy": "Unsupported host selection strategy '%s' specified for this connection provider '%s'. Please visit the documentation for all supported strategies.",
"ConnectionProvider.unsupportedHostInfoSelectorStrategy": "Unsupported host selection strategy '%s' specified for this connection provider '%s'. Please visit the documentation for all supported strategies.",
"ConnectionPluginChainBuilder.errorImportingPlugin": "The plugin could not be imported. Please ensure the required dependencies have been installed. Plugin: '%s'",
"ClientUtils.queryTaskTimeout": "AwsWrapperError: Client query task timed out.",
"DialectManager.unknownDialectCode": "Unknown dialect code: '%s'.",
Expand Down

0 comments on commit 0159447

Please sign in to comment.