diff --git a/includes/Pygmentize.php b/includes/Pygmentize.php index a240fcc8..831ef3a5 100644 --- a/includes/Pygmentize.php +++ b/includes/Pygmentize.php @@ -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;