Improving error reporting API

This commit is contained in:
David Bomba 2016-02-17 10:34:23 +11:00
parent 3e4df4ff4f
commit 1a953c5bcb

View File

@ -744,7 +744,7 @@ class Invoice extends EntityModel implements BalanceAffecting
$opts = [ $opts = [
CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/', CURLOPT_URL => PHANTOMJS_CLOUD . env('PHANTOMJS_CLOUD_KEY') . '/',
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POST => 1, CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $jsonEncodedData, CURLOPT_POSTFIELDS => $jsonEncodedData,
CURLOPT_HTTPHEADER => [ CURLOPT_HTTPHEADER => [
@ -757,13 +757,9 @@ class Invoice extends EntityModel implements BalanceAffecting
$response = curl_exec($curl); $response = curl_exec($curl);
curl_close($curl); curl_close($curl);
Log::info($response);
$encodedString = strip_tags($response); $encodedString = strip_tags($response);
$pdfString = Utils::decodePDF($encodedString); $pdfString = Utils::decodePDF($encodedString);
Log::info($pdfString);
if ( ! $pdfString || strlen($pdfString) < 200) { if ( ! $pdfString || strlen($pdfString) < 200) {
Utils::logError("PhantomJSCloud - failed to create pdf: {$encodedString}"); Utils::logError("PhantomJSCloud - failed to create pdf: {$encodedString}");
} }