File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bundle \FrameworkBundle \CacheWarmer ;
1313
14+ use Doctrine \Common \Annotations \AnnotationException ;
1415use Doctrine \Common \Annotations \CachedReader ;
1516use Doctrine \Common \Annotations \Reader ;
1617use Psr \Cache \CacheItemPoolInterface ;
@@ -75,6 +76,15 @@ public function warmUp($cacheDir)
7576 $ this ->readAllComponents ($ reader , $ class );
7677 } catch (\ReflectionException $ e ) {
7778 // ignore failing reflection
79+ } catch (AnnotationException $ e ) {
80+ /*
81+ * Ignore any AnnotationException to not break the cache warming process if an Annotation is badly
82+ * configured or could not be found / read / etc.
83+ *
84+ * In particular cases, an Annotation in your code can be used and defined only for a specific
85+ * environment but is always added to the annotations.map file by some Symfony default behaviors,
86+ * and you always end up with a not found Annotation.
87+ */
7888 }
7989 }
8090 } finally {
You can’t perform that action at this time.
0 commit comments