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

Breadcrumb

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

function ProcessFailedException::__construct

1 method overrides ProcessFailedException::__construct()
ProcessStartFailedException::__construct in vendor/symfony/process/Exception/ProcessStartFailedException.php

File

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

Class

ProcessFailedException
Exception for failed processes.

Namespace

Symfony\Component\Process\Exception

Code

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;
}

API Navigation

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