type = get_class($exception); $this->message = $exception->getMessage(); $this->code = $exception->getCode(); $this->trace = $exception->getTraceAsString(); } /** * {@inheritdoc} */ public function getException() { return new TaskError( sprintf('Uncaught exception in worker of type "%s" with message "%s"', $this->type, $this->message), $this->code, $this->trace ); } }