I want to test, if the value is a Throwable, if it is, I want to print out an error message.
If the value is not a Throwable, I want to return it.
I have this code, which gives me following error message, when Im hovering over the "value" which sould be returned in the last line:
Found: (value : Either[Throwable, A]) Required: A )
def throwAndPlayAgainOrGet[A](value: Either[Throwable, A]): A =
{
if(value.isLeft) println("error: " + value) + playAgain
value
}
My Question:
how can I do that?
Eitherinto theZIO