akka-stream compiler warnings as fatal errors (#26673)

This commit is contained in:
Johan Andrén 2019-04-05 13:06:33 +02:00 committed by GitHub
parent 6207484c0e
commit 7e7901ad49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 276 additions and 183 deletions

View file

@ -107,11 +107,12 @@ import scala.util.control.NonFatal
private def createResource(): Unit = {
create().onComplete { resource =>
createdCallback(resource).recover {
createdCallback(resource).failed.foreach {
case _: StreamDetachedException =>
// stream stopped
resource match {
case Success(r) => close(r)
case Success(r) =>
close(r)
case Failure(ex) => throw ex // failed to open but stream is stopped already
}
}