PHP Class Newscoop\GimmeBundle\Controller\ExceptionController

Inheritance: extends FOS\RestBundle\Controller\ExceptionController
Show file Open project: sourcefabric/newscoop

Public Methods

Method Description
showAction ( Request $request, FlattenException $exception, Symfony\Component\HttpKernel\Log\DebugLoggerInterface $logger = null, string $format = 'html' ) : Response Newscoop REST API exceptions Controller.

Protected Methods

Method Description
createExceptionWrapper ( array $parameters )
getFormat ( Request $request, string $format ) : string Determine the format to use for the response
getParameters ( FOS\RestBundle\View\ViewHandler $viewHandler, $currentContent, $code, FlattenException $exception, Symfony\Component\HttpKernel\Log\DebugLoggerInterface $logger = null, $format = 'html' )

Method Details

createExceptionWrapper() protected method

protected createExceptionWrapper ( array $parameters )
$parameters array

getFormat() protected method

Determine the format to use for the response
protected getFormat ( Request $request, string $format ) : string
$request Symfony\Component\HttpFoundation\Request Request instance
$format string The format to use for rendering (html, xml, ...)
return string Encoding format

getParameters() protected method

protected getParameters ( FOS\RestBundle\View\ViewHandler $viewHandler, $currentContent, $code, FlattenException $exception, Symfony\Component\HttpKernel\Log\DebugLoggerInterface $logger = null, $format = 'html' )
$viewHandler FOS\RestBundle\View\ViewHandler
$exception Symfony\Component\HttpKernel\Exception\FlattenException
$logger Symfony\Component\HttpKernel\Log\DebugLoggerInterface

showAction() public method

Converts an Exception to a Response. TODO: change exceptions handling in listener - this controller should deal only with REST API exceptions.
public showAction ( Request $request, FlattenException $exception, Symfony\Component\HttpKernel\Log\DebugLoggerInterface $logger = null, string $format = 'html' ) : Response
$request Symfony\Component\HttpFoundation\Request Request
$exception Symfony\Component\HttpKernel\Exception\FlattenException A FlattenException instance
$logger Symfony\Component\HttpKernel\Log\DebugLoggerInterface A DebugLoggerInterface instance
$format string The format to use for rendering (html, xml, ...)
return Response Response instance