=str #20550 only accept -1 for infinite retries in recoverWithRetries (#20555)

This commit is contained in:
Samuel Tardieu 2016-05-19 11:45:31 +02:00 committed by Konrad Malawski
parent acb71ac4e5
commit e0c64f59d8
4 changed files with 16 additions and 2 deletions

View file

@ -1259,6 +1259,7 @@ private[stream] object RecoverWith {
}
private[stream] final class RecoverWith[T, M](maximumRetries: Int, pf: PartialFunction[Throwable, Graph[SourceShape[T], M]]) extends SimpleLinearGraphStage[T] {
require(maximumRetries >= -1, "number of retries must be non-negative or equal to -1")
override def initialAttributes = DefaultAttributes.recoverWith
override def createLogic(attr: Attributes) = new GraphStageLogic(shape) {