mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 16:31:33 +02:00
Catch PhantomJS exceptions
This commit is contained in:
parent
a7ffcfe7b2
commit
ee0f2daa48
@ -1193,7 +1193,9 @@ class Invoice extends EntityModel implements BalanceAffecting
|
||||
|
||||
$invitation = $this->invitations[0];
|
||||
$link = $invitation->getLink('view', true);
|
||||
$pdfString = false;
|
||||
|
||||
try {
|
||||
if (env('PHANTOMJS_BIN_PATH')) {
|
||||
$pdfString = CurlUtils::phantom('GET', $link . '?phantomjs=true');
|
||||
} elseif ($key = env('PHANTOMJS_CLOUD_KEY')) {
|
||||
@ -1205,9 +1207,13 @@ class Invoice extends EntityModel implements BalanceAffecting
|
||||
}
|
||||
|
||||
$pdfString = strip_tags($pdfString);
|
||||
} catch (Exception $exception) {
|
||||
Utils::logError("PhantomJS - Failed to create pdf: {$exception->getMessage()}");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $pdfString || strlen($pdfString) < 200) {
|
||||
Utils::logError("PhantomJSCloud - failed to create pdf: {$pdfString}");
|
||||
Utils::logError("PhantomJS - Failed to create pdf: {$pdfString}");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user