protected function createResponseFromException(\Exception $e, JsonRequest $request)
    {
        $response = new JsonResponse();
        $response->setId($request->getId());

        $response->setErrorMessage($e->getMessage());
        $response->setErrorCode($e->getCode());

        return $response;
    }
protected function createResponseFromException(\Exception $e, JsonRequest $request)
    {
        $response = new JsonResponse();
        $response->setId($request->getId());

        $response->setErrorMessage($e->getMessage());
        $response->setErrorCode($e->getCode());

        return $response;
    }
protected function createResponseFromException ( \ Exception $ e , JsonRequest $ request ) { $ response = new JsonResponse ( ) ; $ response -> setId ( $ request -> getId ( ) ) ; $ response -> setErrorMessage ( $ e -> getMessage ( ) ) ; $ response -> setErrorCode ( $ e -> getCode ( ) ) ; return $ response ; }
Create response from exception and request.

@param \Exception  $e
@param JsonRequest $request

@return JsonResponse
Create response from exception and request .