[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
parent a7d4a56b14
commit 8c5486ba13
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0

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);
});