Skip to content

Commit 4c5aa14

Browse files
authored
chore: failover errors fix (#405)
1 parent 89a4d17 commit 4c5aa14

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

common/lib/plugins/failover/failover_plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export class FailoverPlugin extends AbstractConnectionPlugin {
383383
} else {
384384
// "The active SQL connection has changed due to a connection failure. Please re-configure
385385
// session state if required."
386-
throw new FailoverSuccessError(Messages.get("Failover.connectionChangedError"));
386+
throw new FailoverSuccessError();
387387
}
388388
}
389389

common/lib/plugins/failover2/failover2_plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export class Failover2Plugin extends AbstractConnectionPlugin implements CanRele
242242
} else {
243243
// "The active SQL connection has changed due to a connection failure. Please re-configure
244244
// session state if required."
245-
throw new FailoverSuccessError(Messages.get("Failover.connectionChangedError"));
245+
throw new FailoverSuccessError();
246246
}
247247
}
248248

common/lib/utils/errors.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
limitations under the License.
1515
*/
1616

17+
import { Messages } from "./messages";
18+
1719
export class AwsWrapperError extends Error {
1820
constructor(message?: string, cause?: any) {
1921
super(message);
@@ -30,7 +32,11 @@ export class IllegalArgumentError extends AwsWrapperError {}
3032

3133
export class FailoverError extends AwsWrapperError {}
3234

33-
export class FailoverSuccessError extends FailoverError {}
35+
export class FailoverSuccessError extends FailoverError {
36+
constructor(message?: string, cause?: any) {
37+
super(Messages.get("Failover.connectionChangedError"));
38+
}
39+
}
3440

3541
export class FailoverFailedError extends FailoverError {}
3642

common/lib/utils/locales/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136
"MonitorImpl.stopped": "Stopped monitoring for host '%s'.",
137137
"MonitorImpl.startMonitoring": "Start monitoring for %s.",
138138
"MonitorImpl.stopMonitoring": "Stop monitoring for %s.",
139-
"MonitorImpl.startMonitoringTaskNewContext": "Start monitoring thread for checking new contexts for '%s'",
140-
"MonitorImpl.stopMonitoringTaskNewContext": "Stop monitoring thread for checking new contexts for '%s'",
139+
"MonitorImpl.startMonitoringTaskNewContext": "Start monitoring task for checking new contexts for '%s'",
140+
"MonitorImpl.stopMonitoringTaskNewContext": "Stop monitoring task for checking new contexts for '%s'",
141141
"MonitorService.startMonitoringNullMonitor": "Start monitoring called but could not find monitor for host: '%s'.",
142142
"MonitorService.emptyAliasSet": "Empty alias set passed for '%s'. Set should not be empty.",
143143
"PluginService.hostListEmpty": "Current host list is empty.",
@@ -220,7 +220,7 @@
220220
"ClusterTopologyMonitor.errorFetchingTopology": "Error fetching topology: '%s'.",
221221
"ClusterTopologyMonitoring.ignoringNewTopologyRequest": "Previous failover has just completed, ignoring new topology request.",
222222
"ClusterTopologyMonitoring.timeoutSetToZero": "A topology refresh was requested, but the given timeout for the request was 0 ms. Returning cached hosts: ",
223-
"ClusterTopologyMonitor.startingHostMonitors": "Starting host monitoring threads.",
223+
"ClusterTopologyMonitor.startingHostMonitors": "Starting host monitoring tasks.",
224224
"ClusterTopologyMonitor.writerPickedUpFromHostMonitors": "The writer host detected by the node monitors was picked up by the topology monitor: '%s'.",
225225
"ClusterTopologyMonitor.writerMonitoringConnection": "The monitoring connection is connected to a writer: '%s'.",
226226
"ClusterTopologyMonitor.invalidWriterQuery": "An error occurred while attempting to obtain the writer id because the query was invalid. Please ensure you are connecting to an Aurora or RDS DB cluster. Error: '%s'",

0 commit comments

Comments
 (0)