mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
Merge "Pygmentize: report stderr when exit code != 0 and stdout is empty"
This commit is contained in:
commit
ce65160b40
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue