@@ -23,8 +23,9 @@ class FileLoaderLoadException extends \Exception
2323 * @param string $sourceResource The original resource importing the new resource
2424 * @param int $code The error code
2525 * @param \Exception $previous A previous exception
26+ * @param string $type The type of resource
2627 */
27- public function __construct ($ resource , $ sourceResource = null , $ code = null , $ previous = null )
28+ public function __construct ($ resource , $ sourceResource = null , $ code = null , $ previous = null , $ type = null )
2829 {
2930 $ message = '' ;
3031 if ($ previous ) {
@@ -60,6 +61,13 @@ public function __construct($resource, $sourceResource = null, $code = null, $pr
6061 $ bundle = substr ($ parts [0 ], 1 );
6162 $ message .= sprintf (' Make sure the "%s" bundle is correctly registered and loaded in the application kernel class. ' , $ bundle );
6263 $ message .= sprintf (' If the bundle is registered, make sure the bundle path "%s" is not empty. ' , $ resource );
64+ } elseif (null !== $ type ) {
65+ // maybe there is no loader for this specific type
66+ if ('annotation ' === $ type ) {
67+ $ message .= ' Make sure annotations are enabled. ' ;
68+ } else {
69+ $ message .= sprintf (' Make sure there is a loader supporting the "%s" type. ' , $ type );
70+ }
6371 }
6472
6573 parent ::__construct ($ message , $ code , $ previous );
0 commit comments