public static function FilterException::fromProcess

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php, line 26

Class

FilterException
Describes an exception that occurred within a filter.

Namespace

Assetic\Exception

Code

public static function fromProcess(Process $proc) {
  $message = sprintf("An error occurred while running:\n%s", $proc
    ->getCommandLine());
  $errorOutput = $proc
    ->getErrorOutput();
  if (!empty($errorOutput)) {
    $message .= "\n\nError Output:\n" . str_replace("\r", '', $errorOutput);
  }
  $output = $proc
    ->getOutput();
  if (!empty($output)) {
    $message .= "\n\nOutput:\n" . str_replace("\r", '', $output);
  }
  return new self($message);
}