diff --git a/src/future/Future.php b/src/future/Future.php --- a/src/future/Future.php +++ b/src/future/Future.php @@ -41,15 +41,15 @@ 'timeout.')); } - if ($this->hasException()) { - throw $this->getException(); - } - - if (!$this->hasResult()) { + if (!$this->hasResult() && !$this->hasException()) { $graph = new FutureIterator(array($this)); $graph->resolveAll(); } + if ($this->hasException()) { + throw $this->getException(); + } + return $this->getResult(); }