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);
    }