-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bulk load CDK: nondocker runner throws exception if destination fails (…
- Loading branch information
Showing
5 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
airbyte-cdk/bulk/core/base/src/main/kotlin/io/airbyte/cdk/ConnectorUncleanExitException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk | ||
|
||
class ConnectorUncleanExitException(val exitCode: Int) : | ||
Exception("Destination process exited uncleanly: $exitCode") |
33 changes: 33 additions & 0 deletions
33
...tlin/io/airbyte/cdk/load/test/util/destination_process/DestinationUncleanExitException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.cdk.load.test.util.destination_process | ||
|
||
import io.airbyte.protocol.models.v0.AirbyteErrorTraceMessage | ||
import io.airbyte.protocol.models.v0.AirbyteTraceMessage | ||
|
||
class DestinationUncleanExitException( | ||
exitCode: Int, | ||
traceMessages: List<AirbyteErrorTraceMessage> | ||
) : | ||
Exception( | ||
""" | ||
Destination process exited uncleanly: $exitCode | ||
Trace messages: | ||
""".trimIndent() | ||
// explicit concat because otherwise trimIndent behaves badly | ||
+ traceMessages | ||
) { | ||
companion object { | ||
// generic type erasure strikes again >.> | ||
// this can't just be a second constructor, because both constructors | ||
// would have signature `traceMessages: List`. | ||
// so we have to pull this into a companion object function. | ||
fun of(exitCode: Int, traceMessages: List<AirbyteTraceMessage>) = | ||
DestinationUncleanExitException( | ||
exitCode, | ||
traceMessages.filter { it.type == AirbyteTraceMessage.Type.ERROR }.map { it.error } | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters