@@ -23,8 +23,9 @@ class FileLoaderLoadException extends \Exception
23
23
* @param string $sourceResource The original resource importing the new resource
24
24
* @param int $code The error code
25
25
* @param \Exception $previous A previous exception
26
+ * @param string $type The type of resource
26
27
*/
27
- public function __construct ($ resource , $ sourceResource = null , $ code = null , $ previous = null )
28
+ public function __construct ($ resource , $ sourceResource = null , $ code = null , $ previous = null , $ type = null )
28
29
{
29
30
$ message = '' ;
30
31
if ($ previous ) {
@@ -60,6 +61,13 @@ public function __construct($resource, $sourceResource = null, $code = null, $pr
60
61
$ bundle = substr ($ parts [0 ], 1 );
61
62
$ message .= sprintf (' Make sure the "%s" bundle is correctly registered and loaded in the application kernel class. ' , $ bundle );
62
63
$ 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
+ }
63
71
}
64
72
65
73
parent ::__construct ($ message , $ code , $ previous );
0 commit comments