mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: improve error handling in SSH connection
This commit is contained in:
@@ -173,7 +173,7 @@ export class MySQLClient extends BaseClient {
|
||||
remotePort: this._params.port
|
||||
});
|
||||
|
||||
dbConfig.host = (this._ssh.config as SSHConfig[] & { host: string }).host;
|
||||
dbConfig.host = this._ssh.config[0].host;
|
||||
dbConfig.port = tunnel.localPort;
|
||||
}
|
||||
catch (err) {
|
||||
@@ -302,6 +302,8 @@ export class MySQLClient extends BaseClient {
|
||||
await this.connect();
|
||||
return this.getConnection(args, true);
|
||||
}
|
||||
else if (error instanceof AggregateError)
|
||||
throw new Error(error.errors.reduce((acc, curr) => acc +' | '+ curr.message, ''));
|
||||
else
|
||||
throw new Error(error.message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user