title: Scala : Understanding Future.recover
body: <p>I am playing around with <code>Future.recover</code> (through  a scala sheet in intelJ if it has any importance)</p>
  
  <pre><code>import scala.concurrent.Future
  import scala.concurrent.ExecutionContext.Implicits.global
  
  def get():Future[Int] = {
    throw new ClassCastException
  }
  
  val n = get().map{
    x =&gt; x + 1
  
  }.recover{
    case e: Throwable =&gt; print("we recovered")
      0
  }
  
  n.map(print(_)) // not getting here
  </code></pre>
  
  <p>I was expecting <code>0</code> to be printed. However, this what I am getting:</p>
  
  <pre><code>java.lang.ClassCastException
      at #worksheet#.get(test.sc:5)
      at #worksheet#.n$lzycompute(test.sc:8)
      at #worksheet#.n(test.sc:8)
      at #worksheet#.get$$instance$$n(test.sc:8)
      at A$A76$.main(test.sc:32)
      at #worksheet#.#worksheet#(test.sc)
  </code></pre>
  
  <p>Why is my <code>recover</code> not working. am I using it incorrectly ?</p>