Skip to content

Commit

Permalink
Merge pull request #1519 from jpwhite4/chrome_fail
Browse files Browse the repository at this point in the history
Change chromium output error detection.
  • Loading branch information
jpwhite4 authored Mar 30, 2021
2 parents 50d31d7 + bd365e5 commit bf6c030
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libraries/charting.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ function getSvgFromChromium($html, $width, $height){

@unlink($tmpHtmlFile);

if ($return_value != 0) {
throw new \Exception('Unable execute command: "'. $command . '". Details: ' . $err);
}
$result = json_decode(substr($out, 4, -6), true);

if ($result === null || !isset($result['result']) || !isset($result['result']['value'])) {
throw new \Exception('Error executing command: "'. $command . '". Details: ' . $return_value . " " . $out . ' Errors: ' . $err);
}

return $result['result']['value'];
}

Expand Down

0 comments on commit bf6c030

Please sign in to comment.