diff options
author | phaller <hallerp@gmail.com> | 2012-04-14 20:37:14 +0200 |
---|---|---|
committer | phaller <hallerp@gmail.com> | 2012-04-14 20:37:14 +0200 |
commit | 23aa1a8d7b08b767f90657baf9bc13a355682671 (patch) | |
tree | 7243f629540c7c34b89d5de5fc12d788133f00f7 /src/library/scala/concurrent/impl/Future.scala | |
parent | 1246f69185d958f12ebbff047fc3a72766cfd384 (diff) | |
download | scala-23aa1a8d7b08b767f90657baf9bc13a355682671.tar.gz scala-23aa1a8d7b08b767f90657baf9bc13a355682671.tar.bz2 scala-23aa1a8d7b08b767f90657baf9bc13a355682671.zip |
Fix issues with exception handling in futures. Review by @heathermiller
Diffstat (limited to 'src/library/scala/concurrent/impl/Future.scala')
-rw-r--r-- | src/library/scala/concurrent/impl/Future.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/library/scala/concurrent/impl/Future.scala b/src/library/scala/concurrent/impl/Future.scala index 1cc9e95463..9743c37403 100644 --- a/src/library/scala/concurrent/impl/Future.scala +++ b/src/library/scala/concurrent/impl/Future.scala @@ -71,14 +71,18 @@ object Future { def apply[T](body: =>T)(implicit executor: ExecutionContext): Future[T] = { val promise = new Promise.DefaultPromise[T]() + + //TODO: shouldn't the following be: + //dispatchFuture(executor, () => { promise complete Right(body) }) + executor.execute(new Runnable { def run = { promise complete { try { Right(body) } catch { - case NonFatal(e) => - executor.reportFailure(e) + case e => + //executor.reportFailure(e) scala.concurrent.resolver(e) } } |