NilPortugues\Symfony\JsonApiBundle\Serializer\JsonApiResponseTrait::errorResponse PHP Method

errorResponse() protected method

protected errorResponse ( string $json ) : Response
$json string
return Symfony\Component\HttpFoundation\Response
    protected function errorResponse($json)
    {
        $error = new Error('Bad Request', json_decode($json));
        return $this->createResponse(new BadRequest(new ErrorBag([$error])));
    }