private function getJsonException(\Exception $e)
    {
        $file = Path::makeRelative($e->getFile(), $this->app['path_resolver']->resolve('root'));

        $error = [
            'error' => [
                'type'    => get_class($e),
                'file'    => $file,
                'line'    => $e->getLine(),
                'message' => $e->getMessage(),
            ],
        ];

        return new JsonResponse($error, Response::HTTP_INTERNAL_SERVER_ERROR);
    }
private function getJsonException(\Exception $e)
    {
        $file = Path::makeRelative($e->getFile(), $this->app['path_resolver']->resolve('root'));

        $error = [
            'error' => [
                'type'    => get_class($e),
                'file'    => $file,
                'line'    => $e->getLine(),
                'message' => $e->getMessage(),
            ],
        ];

        return new JsonResponse($error, Response::HTTP_INTERNAL_SERVER_ERROR);
    }
private function getJsonException ( \ Exception $ e ) { $ file = Path :: makeRelative ( $ e -> getFile ( ) , $ this -> app [ 'path_resolver' ] -> resolve ( 'root' ) ) ; $ error = [ 'error' => [ 'type' => get_class ( $ e ) , 'file' => $ file , 'line' => $ e -> getLine ( ) , 'message' => $ e -> getMessage ( ) , ] , ] ; return new JsonResponse ( $ error , Response :: HTTP_INTERNAL_SERVER_ERROR ) ; }
Return an exception formatted as JSON.

@param \Exception $e

@return JsonResponse
Return an exception formatted as JSON .