Merge "Pygmentize: report stderr when exit code != 0 and stdout is empty"

This commit is contained in:
jenkins-bot 2024-05-20 13:31:10 +00:00 committed by Gerrit Code Review
commit ce65160b40

View file

@ -298,7 +298,11 @@ class Pygmentize {
$output = $result->getStdout();
if ( $result->getExitCode() != 0 ) {
throw new PygmentsException( $output );
if ( $output === "" || $output === null ) {
// Stdout was empty, report stderr instead
$output = $result->getStderr();
}
throw new PygmentsException( (string)$output );
}
return $output;