setException() public method

Set the exception thrown by the callback.
public setException ( Exceptio\Exception | null $exception )
$exception Exceptio\Exception | null
Ejemplo n.º 1
0
 /**
  * Execute the callback, but swallow exceptions.
  *
  * @return void
  */
 protected function executeMutedCallback()
 {
     try {
         $this->result->setValue(call_user_func_array($this->callback, $this->params));
     } catch (Exception $exception) {
         $this->result->setException($exception);
         $this->result->setValue(null);
     }
 }
Ejemplo n.º 2
0
 public function test_result_can_have_exception()
 {
     $r = new Result();
     $r->setException(new Exception());
     $this->assertInstanceOf('\\Exception', $r->getException());
 }