Skip to content

Commit

Permalink
Expose java beam error handler API
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Aug 21, 2024
1 parent bc2c965 commit 513118f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scio-core/src/main/scala/com/spotify/scio/ScioContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import scala.reflect.ClassTag
import scala.util.control.NoStackTrace
import scala.util.{Failure, Success, Try}
import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions
import org.apache.beam.sdk.transforms.errorhandling.{BadRecord, ErrorHandler}

/** Runner specific context. */
trait RunnerContext {
Expand Down Expand Up @@ -854,6 +855,11 @@ class ScioContext private[scio] (
// =======================================================================
// Error handler
// =======================================================================
def registerBadRecordErrorHandler[T <: POutput](
sinkTransform: PTransform[PCollection[BadRecord], T]
): ErrorHandler[BadRecord, T] =
pipeline.registerBadRecordErrorHandler(sinkTransform)

def errorSink(): ErrorSink = ErrorSink(this)

// =======================================================================
Expand Down

0 comments on commit 513118f

Please sign in to comment.