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 11
11
12
12
namespace Symfony \Bundle \FrameworkBundle \CacheWarmer ;
13
13
14
+ use Doctrine \Common \Annotations \AnnotationException ;
14
15
use Doctrine \Common \Annotations \CachedReader ;
15
16
use Doctrine \Common \Annotations \Reader ;
16
17
use Psr \Cache \CacheItemPoolInterface ;
@@ -75,6 +76,15 @@ public function warmUp($cacheDir)
75
76
$ this ->readAllComponents ($ reader , $ class );
76
77
} catch (\ReflectionException $ e ) {
77
78
// 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
+ */
78
88
}
79
89
}
80
90
} finally {
You can’t perform that action at this time.
0 commit comments