[FIXTURES] Catch any exception, we don't have VIPS-related only
This commit is contained in:
parent
aa8412f607
commit
e7b985a460
|
@ -6,6 +6,7 @@ use App\Core\DB\DB;
|
||||||
use App\Core\GSFile;
|
use App\Core\GSFile;
|
||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
use Exception;
|
||||||
use Functional as F;
|
use Functional as F;
|
||||||
use Symfony\Component\HttpFoundation\File\File;
|
use Symfony\Component\HttpFoundation\File\File;
|
||||||
|
|
||||||
|
@ -21,8 +22,8 @@ class MediaFixtures extends Fixture
|
||||||
$file = new File($copy_filepath, checkPath: true);
|
$file = new File($copy_filepath, checkPath: true);
|
||||||
try {
|
try {
|
||||||
GSFile::sanitizeAndStoreFileAsAttachment($file);
|
GSFile::sanitizeAndStoreFileAsAttachment($file);
|
||||||
} catch (\Jcupitt\Vips\Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo "Could not save file {$copy_filepath}\n";
|
echo "Could not save file {$copy_filepath}, failed with {$e}\n";
|
||||||
}
|
}
|
||||||
@unlink($copy_filepath);
|
@unlink($copy_filepath);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user