Note that the problem occurs with the code in testAfterAllFailure2, and does not occur in testAfterAllFailure1.
The issues appears to be with the Promise.futureToPromise implicit cast.
I removed the implicit @:from cast, and it fixed the issue.
When the arg is a Future<Result<Dynamic, Error>>, the resulting promise
was getting re-wrapped in the Right constructor, even though it was
already a Right or Left, which made errors become Right(Left(error)),
rather than just Left(error).
Resolve #4
Note that the problem occurs with the code in
testAfterAllFailure2
, and does not occur intestAfterAllFailure1
.The issues appears to be with the Promise.futureToPromise implicit cast. I removed the implicit
@:from
cast, and it fixed the issue.When the arg is a Future<Result<Dynamic, Error>>, the resulting promise was getting re-wrapped in the Right constructor, even though it was already a Right or Left, which made errors become Right(Left(error)), rather than just Left(error).