original_string: private function hasFailed(TaskExecutionInterface $execution, \Exception $exception)
      {
          // this find is necessary because the storage could be
          // invalid (clear in doctrine) after handling an execution.
          $execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
          $execution->setException($exception->__toString());
          $execution->setStatus(TaskStatus::FAILED);
  
          $this->eventDispatcher->dispatch(
              Events::TASK_FAILED,
              new TaskExecutionEvent($execution->getTask(), $execution)
          );
  
          return $execution;
      }
code: private function hasFailed(TaskExecutionInterface $execution, \Exception $exception)
      {
          // this find is necessary because the storage could be
          // invalid (clear in doctrine) after handling an execution.
          $execution = $this->taskExecutionRepository->findByUuid($execution->getUuid());
          $execution->setException($exception->__toString());
          $execution->setStatus(TaskStatus::FAILED);
  
          $this->eventDispatcher->dispatch(
              Events::TASK_FAILED,
              new TaskExecutionEvent($execution->getTask(), $execution)
          );
  
          return $execution;
      }
code_tokens: private function hasFailed ( TaskExecutionInterface $ execution , \ Exception $ exception ) { // this find is necessary because the storage could be // invalid (clear in doctrine) after handling an execution. $ execution = $ this -> taskExecutionRepository -> findByUuid ( $ execution -> getUuid ( ) ) ; $ execution -> setException ( $ exception -> __toString ( ) ) ; $ execution -> setStatus ( TaskStatus :: FAILED ) ; $ this -> eventDispatcher -> dispatch ( Events :: TASK_FAILED , new TaskExecutionEvent ( $ execution -> getTask ( ) , $ execution ) ) ; return $ execution ; }
docstring: The given task failed the run.
  
  @param TaskExecutionInterface $execution
  @param \Exception $exception
  
  @return TaskExecutionInterface
docstring_tokens: The given task failed the run .