Improved error message when no supported user provider is found

This commit is contained in:
Wouter de Jong 2020-01-25 13:51:20 +01:00 committed by Nicolas Grekas
parent d90a503160
commit 6b2db6dc30
3 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@ class ChainUserProvider implements UserProviderInterface
$e->setUsername($user->getUsername()); $e->setUsername($user->getUsername());
throw $e; throw $e;
} else { } else {
throw new UnsupportedUserException(sprintf('The account "%s" is not supported.', \get_class($user))); throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', \get_class($user)));
} }
} }

View File

@ -238,7 +238,7 @@ class ContextListener implements ListenerInterface
return null; return null;
} }
throw new \RuntimeException(sprintf('There is no user provider for user "%s".', $userClass)); throw new \RuntimeException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $userClass));
} }
private function safelyUnserialize($serializedToken) private function safelyUnserialize($serializedToken)

View File

@ -239,7 +239,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
} }
} }
throw new UnsupportedUserException(sprintf('There is no user provider that supports class "%s".', $class)); throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $class));
} }
/** /**