Skip to content

Commit

Permalink
handle psqlexception
Browse files Browse the repository at this point in the history
  • Loading branch information
edgao committed Feb 14, 2024
1 parent dba13b1 commit 0d6e7f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.airbyte.cdk.db.jdbc.JdbcUtils;
import io.airbyte.cdk.integrations.base.AirbyteExceptionHandler;
import io.airbyte.cdk.integrations.base.Destination;
import io.airbyte.cdk.integrations.base.IntegrationRunner;
import io.airbyte.cdk.integrations.base.spec_modification.SpecModifyingDestination;
Expand All @@ -15,6 +16,7 @@
import io.airbyte.protocol.models.v0.AirbyteConnectionStatus.Status;
import io.airbyte.protocol.models.v0.ConnectorSpecification;
import java.util.Set;
import org.postgresql.util.PSQLException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -66,6 +68,7 @@ public boolean isV2Destination() {
}

public static void main(final String[] args) throws Exception {
AirbyteExceptionHandler.addThrowableForDeinterpolation(PSQLException.class);
final Destination destination = new PostgresDestinationStrictEncrypt();
LOGGER.info("starting destination: {}", PostgresDestinationStrictEncrypt.class);
new IntegrationRunner(destination).run(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.airbyte.cdk.db.factory.DataSourceFactory;
import io.airbyte.cdk.db.factory.DatabaseDriver;
import io.airbyte.cdk.db.jdbc.JdbcUtils;
import io.airbyte.cdk.integrations.base.AirbyteExceptionHandler;
import io.airbyte.cdk.integrations.base.Destination;
import io.airbyte.cdk.integrations.base.IntegrationRunner;
import io.airbyte.cdk.integrations.base.ssh.SshWrappedDestination;
Expand All @@ -28,6 +29,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.postgresql.util.PSQLException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -133,6 +135,7 @@ public boolean isV2Destination() {
}

public static void main(final String[] args) throws Exception {
AirbyteExceptionHandler.addThrowableForDeinterpolation(PSQLException.class);
final Destination destination = PostgresDestination.sshWrappedDestination();
LOGGER.info("starting destination: {}", PostgresDestination.class);
new IntegrationRunner(destination).run(args);
Expand Down

0 comments on commit 0d6e7f2

Please sign in to comment.