Skip to content

not throwing config error #36577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 5, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package io.airbyte.cdk.integrations.base

import com.fasterxml.jackson.databind.JsonNode
import com.google.common.annotations.VisibleForTesting
import io.airbyte.cdk.integrations.util.ConnectorExceptionUtil
import java.util.*
import java.util.regex.Pattern
import javax.validation.constraints.NotNull
Expand All @@ -28,6 +29,12 @@ class AirbyteExceptionHandler : Thread.UncaughtExceptionHandler {
// https://docs.google.com/document/d/1ctrj3Yh_GjtQ93aND-WH3ocqGxsmxyC3jfiarrF6NY0/edit#
LOGGER.error(logMessage, throwable)

val rootThrowable = ConnectorExceptionUtil.getRootConfigError(Exception(throwable))

if (ConnectorExceptionUtil.isConfigError(rootThrowable)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since destinations also use this handler. Is the expected behavior shared by them as well?
cc: @jbfbell

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me, so essentially if it's a config error, don't throw two errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly - it will still exit 1, but we are not sending a system_error trace message anymore to platform if it's a config error.

terminate()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this exit 1 or exit 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

// Attempt to deinterpolate the error message before emitting a trace message
val mangledMessage: String?
// If any exception in the chain is of a deinterpolatable type, find it and deinterpolate
Expand Down
Loading