Skip to content

Commit

Permalink
[Config] tweaked exception message when a resource can't be loaded. T…
Browse files Browse the repository at this point in the history
…he new exception message reminds to check if the bundle is correctly loaded in the kernel class when trying to load a resource coming from a bundle.
  • Loading branch information
Hugo Hamon committed Jul 1, 2011
1 parent e167092 commit fb4dea6
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -32,6 +32,13 @@ public function __construct($resource, $sourceResource = null, $code = null, $pr
$message = sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource));
}

// Is the resource located inside a bundle?
if ('@' === $resource[0]) {
$parts = explode(DIRECTORY_SEPARATOR, $resource);
$bundle = substr($parts[0], 1);
$message .= ' '. sprintf('Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle);
}

parent::__construct($message, $code, $previous);
}

Expand Down

0 comments on commit fb4dea6

Please sign in to comment.