From e31151d1665c391f5835128f312328f652234083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nil=20Portugu=C3=A9s=20Calder=C3=B3?= Date: Sat, 28 May 2016 10:28:56 +0200 Subject: [PATCH] Wrong Exception class was being imported --- src/Serializer/JsonApiSerializer.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Serializer/JsonApiSerializer.php b/src/Serializer/JsonApiSerializer.php index 63dbae2..e6084c4 100644 --- a/src/Serializer/JsonApiSerializer.php +++ b/src/Serializer/JsonApiSerializer.php @@ -8,14 +8,16 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace NilPortugues\Symfony\JsonApiBundle\Serializer; use NilPortugues\Api\JsonApi\JsonApiTransformer; use NilPortugues\Api\Mapping\Mapping; use NilPortugues\Serializer\DeepCopySerializer; use ReflectionClass; +use RuntimeException; use Symfony\Bundle\FrameworkBundle\Routing\Router; -use Symfony\Component\Security\Acl\Exception\Exception; +use Exception; /** * Class JsonApiSerializer. @@ -92,7 +94,7 @@ private function setUrlWithReflection(Router $router, Mapping $mapping, Reflecti * * @return mixed * - * @throws \RuntimeException + * @throws RuntimeException */ private function getUrlPattern(Router $router, $routeNameFromMappingFile) { @@ -102,8 +104,8 @@ private function getUrlPattern(Router $router, $routeNameFromMappingFile) if (empty($route)) { throw new Exception(); } - } catch (\Exception $e) { - throw new \RuntimeException( + } catch (Exception $e) { + throw new RuntimeException( \sprintf('Route \'%s\' has not been defined as a Symfony route.', $routeNameFromMappingFile) ); }