forceError) { throw $this->exeption; } } /** * If force error is set to true, the method send will throw a RuntimeException when is called * @param boolean $forceError * @param \Exception|null $exception */ public function setForceError($forceError, $exception = null) { $this->forceError = $forceError; $this->exeption = $exception instanceof \Exception ? $exception : new RuntimeException(self::ERROR_MESSAGE, -1); } /** * Tells if a RuntimeException will be thrown when the method send is called * @return boolean */ public function isForceError() { return $this->forceError; } }