diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php index 6bc39acc27923..57d6f85f08b05 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php @@ -85,7 +85,7 @@ private function readAllComponents(Reader $reader, string $class) try { $reader->getClassAnnotations($reflectionClass); - } catch (AnnotationException $e) { + } catch (AnnotationException | \ErrorException $e) { /* * Ignore any AnnotationException to not break the cache warming process if an Annotation is badly * configured or could not be found / read / etc. @@ -99,14 +99,14 @@ private function readAllComponents(Reader $reader, string $class) foreach ($reflectionClass->getMethods() as $reflectionMethod) { try { $reader->getMethodAnnotations($reflectionMethod); - } catch (AnnotationException $e) { + } catch (AnnotationException | \ErrorException $e) { } } foreach ($reflectionClass->getProperties() as $reflectionProperty) { try { $reader->getPropertyAnnotations($reflectionProperty); - } catch (AnnotationException $e) { + } catch (AnnotationException | \ErrorException $e) { } } }