public function getResult() { if (!$this->resolved) { throw new \Error("The observable has not resolved"); } if ($this->exception) { throw $this->exception; } return $this->result; }