public static function fromException(\Exception $exception) { return new self($exception->getMessage(), get_class($exception), $exception->getCode(), $exception->getFile(), $exception->getLine(), $exception->getTraceAsString()); }
/** * Create an error stack from an Exception. * * Should be called when an Exception is encountered during * the execution of any of the iteration processes. * * After an exception is encountered the results from this iteration * set are invalid. * * @param \Exception $e */ public function setException(\Exception $exception) { $errors = []; do { $errors[] = Error::fromException($exception); } while ($exception = $exception->getPrevious()); $this->errorStack = new ErrorStack($this, $errors); }