Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProcessFailedException.php

class ProcessFailedException

Exception for failed processes.

@author Johannes M. Schmitt <schmittjoh@gmail.com>

Hierarchy

  • class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
    • class \Symfony\Component\Process\Exception\RuntimeException extends \Symfony\Component\Process\Exception\RuntimeException implements \Symfony\Component\Process\Exception\ExceptionInterface
      • class \Symfony\Component\Process\Exception\ProcessFailedException extends \Symfony\Component\Process\Exception\RuntimeException

Expanded class hierarchy of ProcessFailedException

5 files declare their use of ProcessFailedException
PackageManagerFixtureCreator.php in core/scripts/PackageManagerFixtureCreator.php
Plugin.php in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Process.php in vendor/symfony/process/Process.php
ProcessHelper.php in vendor/symfony/console/Helper/ProcessHelper.php
RunProcessMessageHandler.php in vendor/symfony/process/Messenger/RunProcessMessageHandler.php

File

vendor/symfony/process/Exception/ProcessFailedException.php, line 21

Namespace

Symfony\Component\Process\Exception
View source
class ProcessFailedException extends RuntimeException {
    public function __construct(Process $process) {
        if ($process->isSuccessful()) {
            throw new InvalidArgumentException('Expected a failed process, but the given process was successful.');
        }
        $error = \sprintf('The command "%s" failed.' . "\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText(), $process->getWorkingDirectory());
        if (!$process->isOutputDisabled()) {
            $error .= \sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput());
        }
        parent::__construct($error);
        $this->process = $process;
    }
    public function getProcess() : Process {
        return $this->process;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ProcessFailedException::getProcess public function 1
ProcessFailedException::__construct public function 1

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal