Open
Description
I've been using the aws dynamodb async sdk, but I find that I cannot catch exceptions after I convert a CompletableFuture
to Scala.
When I run
client
.createTable(tableSchema.createTableRequest(tableName))
.thenApply[Unit](_ => Unit)
.exceptionally {
case _: Throwable => // exception is now property handled
}
I can successfully catch the exception.
However when I run
import scala.compat.java8.FutureConverters.toScala
val cf = client
.createTable(tableSchema.createTableRequest(tableName))
toScala(cf).recover {
case _: Throwable => // never gets executed
}
I cannot actually catch the exception. Any clues on why?
Activity
mberchon commentedon Mar 22, 2022
FYI, our team is troubleshooting a similar weird behavior between scala-java8-compat and AWS SDK V2
Context:
For some unexplained reasons, our code works fine if keeping a CompletableFuture but doesn't work when turning it into a Future with the scala-java8-compat.
/!\ I am not saying there is a bug in scala-java8-compat ... but this issue has been routed to me by the team ... so I am trying to give a bit of reflexion to this issue /!\
UPDATE:
Final status in our context:
So definitely not a scala-java8-compat bug but a bug on our side (in our context)