stream: don't wrap exceptions in ByteStringParser (#31311)
This commit is contained in:
parent
30ff7866ee
commit
9ac594e637
2 changed files with 3 additions and 4 deletions
|
|
@ -7,7 +7,6 @@ package tcp
|
|||
|
||||
import scala.util.Random
|
||||
|
||||
import akka.stream.impl.io.ByteStringParser.ParsingException
|
||||
import akka.stream.scaladsl.Flow
|
||||
import akka.stream.scaladsl.Framing.FramingException
|
||||
import akka.stream.scaladsl.Sink
|
||||
|
|
@ -62,8 +61,7 @@ class TcpFramingSpec extends AkkaSpec("""
|
|||
"reject invalid magic" in {
|
||||
val bytes = frameBytes(2)
|
||||
val fail = Source(List(bytes)).via(framingFlow).runWith(Sink.seq).failed.futureValue
|
||||
fail shouldBe a[ParsingException]
|
||||
fail.getCause shouldBe a[FramingException]
|
||||
fail shouldBe a[FramingException]
|
||||
}
|
||||
|
||||
"include streamId in each frame" in {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ import akka.util.ByteString
|
|||
|
||||
DontRecurse
|
||||
case NonFatal(ex) =>
|
||||
failStage(new ParsingException(s"Parsing failed in step $current", ex))
|
||||
failStage(ex)
|
||||
|
||||
DontRecurse
|
||||
}
|
||||
|
|
@ -177,6 +177,7 @@ import akka.util.ByteString
|
|||
throw new IllegalStateException("no initial parser installed: you must use startWith(...)")
|
||||
}
|
||||
|
||||
@deprecated("Deprecated for internal usage. Will not be emitted any more.", "2.6.20")
|
||||
class ParsingException(msg: String, cause: Throwable) extends RuntimeException(msg, cause)
|
||||
|
||||
val NeedMoreData = new Exception with NoStackTrace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue