Skip to content

[ClassLoader] Improve exception messages of the debug class loader #1825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2011

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jul 27, 2011

No description provided.

@@ -55,7 +55,13 @@ class DebugUniversalClassLoader extends UniversalClassLoader
require $file;

if (!class_exists($class, false) && !interface_exists($class, false)) {
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". You probably have a typo in the namespace or the class name.', $class, $file));
if (!file_exists($file)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file always exist at this point.

@Seldaek
Copy link
Member Author

Seldaek commented Jul 31, 2011

Ok, I updated this to just clarify the message, because when I got the issue after some serious copy-paste coding, I thought it was quite confusing - it seems to imply you mistyped the class name when using the class, and therefore it was not found, while the typo is in the class's file itself.

fabpot added a commit that referenced this pull request Aug 2, 2011
Commits
-------

c0571fc [ClassLoader] Improve exception messages of the debug class loader

Discussion
----------

[ClassLoader] Improve exception messages of the debug class loader

---------------------------------------------------------------------------

by Seldaek at 2011/07/31 14:01:40 -0700

Ok, I updated this to just clarify the message, because when I got the issue after some serious copy-paste coding, I thought it was quite confusing - it seems to imply you mistyped the class name when using the class, and therefore it was not found, while the typo is in the class's file itself.
@fabpot fabpot merged commit c0571fc into symfony:master Aug 2, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants