if (file_exists($path)) {
return $path;
}
- return self::_getFile($params);
+ return self::_getFile($params, 0);
});
if ((!$res || !file_exists($res)) && $attempts > 0) {
if (!$res) {
if ($attempts > 0) {
- Log::warning('Farm failure : ' . $log);
+ Log::warning('Farm failure : ' . $output);
return static::_getFile($params, $attempts - 1);
}
- throw new \Exception('Farm failure : ' . $log);
+ throw new \Exception('Farm failure : ' . $output);
}
return $res;
use Cubist\Util\Str;
use Datetime;
use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
$thumbpdf = $this->getAssetDir() . $this->pdfThumbnails;
if (file_exists($thumbpdf)) {
- $res = Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force);
- return $res;
+ try {
+ return Farm::getFileFromPDF($thumbpdf, $page, $format, $resolution, $this->JPEGQuality, $withText, $withGraphics, $version, null, $force, 1);
+ } catch (\Exception $e) {
+ throw new \Exception('Unable to generate thumbnails file from custom PDF "' . $this->pdfThumbnails . '" (original message : ' . $e->getMessage().')');
+ }
} else {
}
}