Intercepting exception using scalatest