I am new to scala and I have no idea at all what's wrong with my code:
I have some Future which may throw exception:
var clean: Future[Boolean];
However, when I try to map
clean.map( b => {
case true => Ok("success")
case false => Ok("failed")
}).recover {
case t => Ok("error: " + t)
}
I get compile error specified in the title.. I totally have no idea where and/which part of my code exactly causes it.. I have googled but it is so difficult to find any clue because scala syntax is so flexible thus so many variations in the internet but the error I get is quite misleading...
Any help will be very appreciated...