private function createInternalServerError(\Exception $exception)
    {
        $message = sprintf(
            '%s: %s (uncaught exception) at %s line %s',
            get_class($exception),
            $exception->getMessage(),
            $exception->getFile(),
            $exception->getLine()
        );

        $this->logger->error($message, array('exception' => $exception));

        $response = [
            'status'  => 'ERROR',
            'message' => JsonResponse::$statusTexts[JsonResponse::HTTP_INTERNAL_SERVER_ERROR]
        ];

        if ($this->debug) {
            $response['exception'] = $this->formatException($exception);
        }

        return new JsonResponse($response, JsonResponse::HTTP_INTERNAL_SERVER_ERROR);
    }
private function createInternalServerError(\Exception $exception)
    {
        $message = sprintf(
            '%s: %s (uncaught exception) at %s line %s',
            get_class($exception),
            $exception->getMessage(),
            $exception->getFile(),
            $exception->getLine()
        );

        $this->logger->error($message, array('exception' => $exception));

        $response = [
            'status'  => 'ERROR',
            'message' => JsonResponse::$statusTexts[JsonResponse::HTTP_INTERNAL_SERVER_ERROR]
        ];

        if ($this->debug) {
            $response['exception'] = $this->formatException($exception);
        }

        return new JsonResponse($response, JsonResponse::HTTP_INTERNAL_SERVER_ERROR);
    }
private function createInternalServerError ( \ Exception $ exception ) { $ message = sprintf ( '%s: %s (uncaught exception) at %s line %s' , get_class ( $ exception ) , $ exception -> getMessage ( ) , $ exception -> getFile ( ) , $ exception -> getLine ( ) ) ; $ this -> logger -> error ( $ message , array ( 'exception' => $ exception ) ) ; $ response = [ 'status' => 'ERROR' , 'message' => JsonResponse :: $ statusTexts [ JsonResponse :: HTTP_INTERNAL_SERVER_ERROR ] ] ; if ( $ this -> debug ) { $ response [ 'exception' ] = $ this -> formatException ( $ exception ) ; } return new JsonResponse ( $ response , JsonResponse :: HTTP_INTERNAL_SERVER_ERROR ) ; }
Create a 500 response.

@param \Exception $exception The exception to log.

@return JsonResponse
Create a 500 response .