FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony
http://symfony.com/doc/master/bundles/FOSRestBundle/index.html
MIT License
2.79k stars 708 forks source link

[2.x] Error: Call to a member function resolveThrowable() on null #2362

Closed williamdes closed 2 years ago

williamdes commented 2 years ago

I am willing to provide as much details as needed, until now by reading the stacktrace I can not understand what this error is about. The property should not be null at this point.

https://github.com/FriendsOfSymfony/FOSRestBundle/blob/2.x/Serializer/Normalizer/AbstractExceptionNormalizer.php#L35

Error: Call to a member function resolveThrowable() on null
#23 /vendor/friendsofsymfony/rest-bundle/Serializer/Normalizer/AbstractExceptionNormalizer.php(35): FOS\RestBundle\Serializer\Normalizer\AbstractExceptionNormalizer::getMessageFromThrowable
#22 /vendor/friendsofsymfony/rest-bundle/Serializer/Normalizer/ExceptionHandler.php(156): FOS\RestBundle\Serializer\Normalizer\ExceptionHandler::convertThrowableToArray
#21 /vendor/friendsofsymfony/rest-bundle/Serializer/Normalizer/ExceptionHandler.php(137): FOS\RestBundle\Serializer\Normalizer\ExceptionHandler::convertToArray
#20 /src/Serializer/Normalizer/ExceptionHandler.php(80): App\Serializer\Normalizer\ExceptionHandler::serializeToJson
#19 /vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php(206): JMS\Serializer\GraphNavigator\SerializationGraphNavigator::accept
#18 /vendor/jms/serializer/src/Serializer.php(252): JMS\Serializer\Serializer::visit
#17 /vendor/jms/serializer/src/Serializer.php(163): JMS\Serializer\Serializer::serialize
#16 /vendor/friendsofsymfony/rest-bundle/Serializer/JMSSerializerAdapter.php(62): FOS\RestBundle\Serializer\JMSSerializerAdapter::serialize
#15 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php(457): FOS\RestBundle\View\ViewHandler::initResponse
#14 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php(423): FOS\RestBundle\View\ViewHandler::createResponse
#13 /vendor/friendsofsymfony/rest-bundle/View/ViewHandler.php(309): FOS\RestBundle\View\ViewHandler::handle
#12 /vendor/friendsofsymfony/rest-bundle/Controller/ExceptionController.php(67): FOS\RestBundle\Controller\ExceptionController::showAction
#11 /vendor/symfony/http-kernel/HttpKernel.php(158): Symfony\Component\HttpKernel\HttpKernel::handleRaw
#10 /vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel::handle
#9 /vendor/symfony/http-kernel/EventListener/ErrorListener.php(60): Symfony\Component\HttpKernel\EventListener\ErrorListener::onKernelException
#8 /vendor/friendsofsymfony/rest-bundle/EventListener/ExceptionListener.php(81): FOS\RestBundle\EventListener\ExceptionListener::onKernelException
#7 /vendor/symfony/event-dispatcher/EventDispatcher.php(304): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}
#6 /vendor/symfony/event-dispatcher/EventDispatcher.php(264): Symfony\Component\EventDispatcher\EventDispatcher::doDispatch
#5 /vendor/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher::callListeners
#4 /vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher::dispatch
#3 /vendor/symfony/http-kernel/HttpKernel.php(219): Symfony\Component\HttpKernel\HttpKernel::handleThrowable
#2 /vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel::handle
#1 /vendor/symfony/http-kernel/Kernel.php(201): Symfony\Component\HttpKernel\Kernel::handle
#0 /public/index.php(26): null
williamdes commented 2 years ago

Fix it or not, I upgraded to 3.x and removed this class ;)