Follow-up fix for SSHExceptions (#18383)
* Follow-up fix for SSHExceptions * Catch RuntimeException instead of augmenting connection error messaging for now * Update tests * Bump versions + docs * auto-bump connector version * auto-bump connector version * auto-bump connector version Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
This commit is contained in:
@@ -303,7 +303,7 @@ public class SshTunnel implements AutoCloseable {
|
||||
* @see <a href=
|
||||
* "https://javadoc.io/static/org.apache.sshd/sshd-common/2.8.0/org/apache/sshd/common/config/keys/loader/KeyPairResourceLoader.html#loadKeyPairs-org.apache.sshd.common.session.SessionContext-org.apache.sshd.common.util.io.resource.IoResource-org.apache.sshd.common.config.keys.FilePasswordProvider-">loadKeyPairs()</a>
|
||||
*/
|
||||
KeyPair getPrivateKeyPair() throws IOException, GeneralSecurityException, ConnectionErrorException {
|
||||
KeyPair getPrivateKeyPair() throws IOException, GeneralSecurityException {
|
||||
final String validatedKey = validateKey();
|
||||
final var keyPairs = SecurityUtils
|
||||
.getKeyPairResourceParser()
|
||||
@@ -312,7 +312,7 @@ public class SshTunnel implements AutoCloseable {
|
||||
if (keyPairs != null && keyPairs.iterator().hasNext()) {
|
||||
return keyPairs.iterator().next();
|
||||
}
|
||||
throw new ConnectionErrorException("Unable to load private key pairs, verify key pairs are properly inputted");
|
||||
throw new RuntimeException("Unable to load private key pairs, verify key pairs are properly inputted");
|
||||
}
|
||||
|
||||
private String validateKey() {
|
||||
|
||||
@@ -67,7 +67,7 @@ public class SshWrappedDestination implements Destination {
|
||||
try {
|
||||
return (endPointKey != null) ? SshTunnel.sshWrap(config, endPointKey, delegate::check)
|
||||
: SshTunnel.sshWrap(config, hostKey, portKey, delegate::check);
|
||||
} catch (final SshException | ConnectionErrorException e) {
|
||||
} catch (final RuntimeException e) {
|
||||
final String sshErrorMessage = "Could not connect with provided SSH configuration. Error: " + e.getMessage();
|
||||
AirbyteTraceMessageUtility.emitConfigErrorTrace(e, sshErrorMessage);
|
||||
return new AirbyteConnectionStatus()
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SshWrappedSource implements Source {
|
||||
public AirbyteConnectionStatus check(final JsonNode config) throws Exception {
|
||||
try {
|
||||
return SshTunnel.sshWrap(config, hostKey, portKey, delegate::check);
|
||||
} catch (final SshException | ConnectionErrorException e) {
|
||||
} catch (final RuntimeException e) {
|
||||
final String sshErrorMessage = "Could not connect with provided SSH configuration. Error: " + e.getMessage();
|
||||
AirbyteTraceMessageUtility.emitConfigErrorTrace(e, sshErrorMessage);
|
||||
return new AirbyteConnectionStatus()
|
||||
|
||||
Reference in New Issue
Block a user