diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-01 14:51:54 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-01 14:58:48 +0200 |
commit | 40e219622a2c416ab36cb39b26a5e1354e4438cc (patch) | |
tree | 878fb4e50ecee04603f8a05dec04f9a4b8662d18 /src/Wallabag/CoreBundle/ParamConverter | |
parent | 114c55c0a6eade2ba6c53fe25f61cc58cca91620 (diff) | |
download | wallabag-40e219622a2c416ab36cb39b26a5e1354e4438cc.tar.gz wallabag-40e219622a2c416ab36cb39b26a5e1354e4438cc.tar.zst wallabag-40e219622a2c416ab36cb39b26a5e1354e4438cc.zip |
Customize errors templates
All error goes to the same template which only display the error message and the status code.
Diffstat (limited to 'src/Wallabag/CoreBundle/ParamConverter')
-rw-r--r-- | src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php b/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php index 6ea2a4f3..40b5673d 100644 --- a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php +++ b/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php | |||
@@ -49,7 +49,7 @@ class UsernameRssTokenConverter implements ParamConverterInterface | |||
49 | $em = $this->registry->getManagerForClass($configuration->getClass()); | 49 | $em = $this->registry->getManagerForClass($configuration->getClass()); |
50 | 50 | ||
51 | // Check, if class name is what we need | 51 | // Check, if class name is what we need |
52 | if ('Wallabag\UserBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) { | 52 | if (null !== $em && 'Wallabag\UserBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) { |
53 | return false; | 53 | return false; |
54 | } | 54 | } |
55 | 55 | ||
@@ -69,9 +69,8 @@ class UsernameRssTokenConverter implements ParamConverterInterface | |||
69 | $username = $request->attributes->get('username'); | 69 | $username = $request->attributes->get('username'); |
70 | $rssToken = $request->attributes->get('token'); | 70 | $rssToken = $request->attributes->get('token'); |
71 | 71 | ||
72 | // Check, if route attributes exists | 72 | if (!$request->attributes->has('username') || !$request->attributes->has('token')) { |
73 | if (null === $username || null === $rssToken) { | 73 | return false; |
74 | throw new \InvalidArgumentException('Route attribute is missing'); | ||
75 | } | 74 | } |
76 | 75 | ||
77 | // Get actual entity manager for class | 76 | // Get actual entity manager for class |