private function createResponseFromOAuthException(OAuth2Exception $exception): ResponseInterface
    {
        $payload = [
            'error' => $exception->getCode(),
            'error_description' => $exception->getMessage(),
        ];

        return new Response\JsonResponse($payload, 400);
    }
private function createResponseFromOAuthException(OAuth2Exception $exception): ResponseInterface
    {
        $payload = [
            'error' => $exception->getCode(),
            'error_description' => $exception->getMessage(),
        ];

        return new Response\JsonResponse($payload, 400);
    }
private function createResponseFromOAuthException ( OAuth2Exception $ exception ) : ResponseInterface { $ payload = [ 'error' => $ exception -> getCode ( ) , 'error_description' => $ exception -> getMessage ( ) , ] ; return new Response \ JsonResponse ( $ payload , 400 ) ; }
Create a response from the exception, using the format of the spec

@link   http://tools.ietf.org/html/rfc6749#section-5.2
Create a response from the exception using the format of the spec