akka.stream.alpakka.kinesis.KinesisErrors.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of akka-stream-alpakka-kinesis_2.12 Show documentation
Show all versions of akka-stream-alpakka-kinesis_2.12 Show documentation
Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
/*
* Copyright (C) 2016-2018 Lightbend Inc.
*/
package akka.stream.alpakka.kinesis
import com.amazonaws.services.kinesis.model.PutRecordsResultEntry
import scala.util.control.NoStackTrace
object KinesisErrors {
sealed trait KinesisSourceError extends NoStackTrace
case object NoShardsError extends KinesisSourceError
case object GetShardIteratorError extends KinesisSourceError
case object GetRecordsError extends KinesisSourceError
sealed trait KinesisFlowErrors extends NoStackTrace
case class FailurePublishingRecords(e: Exception) extends RuntimeException(e) with KinesisFlowErrors
case class ErrorPublishingRecords[T](attempts: Int, recordsWithContext: Seq[(PutRecordsResultEntry, T)])
extends RuntimeException(s"Unable to publish records after $attempts attempts")
with KinesisFlowErrors {
val records = recordsWithContext.map(_._1)
}
}