[FIXTURES] Catch any exception, we don't have VIPS-related only

This commit is contained in:
Diogo Peralta Cordeiro 2021-08-19 01:44:03 +01:00 committed by Hugo Sales
parent aa8412f607
commit e7b985a460
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -6,6 +6,7 @@ use App\Core\DB\DB;
use App\Core\GSFile;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use Exception;
use Functional as F;
use Symfony\Component\HttpFoundation\File\File;
@ -21,8 +22,8 @@ class MediaFixtures extends Fixture
$file = new File($copy_filepath, checkPath: true);
try {
GSFile::sanitizeAndStoreFileAsAttachment($file);
} catch (\Jcupitt\Vips\Exception $e) {
echo "Could not save file {$copy_filepath}\n";
} catch (Exception $e) {
echo "Could not save file {$copy_filepath}, failed with {$e}\n";
}
@unlink($copy_filepath);
});