private function extractError($response)
    {
        $error = array();
        $response = json_decode($response);
        if (property_exists($response, 'error')) {
            if (is_string($response->error->message)) {
                $message = $response->error->message;
            } elseif (is_object($response->error->message)) {
                $message = $response->error->message->value;
            } else {
                $message = "Unknown error";
            }
            $error['Message'] = $message;
            return $error;
        }
        return null;
    }
private function extractError($response)
    {
        $error = array();
        $response = json_decode($response);
        if (property_exists($response, 'error')) {
            if (is_string($response->error->message)) {
                $message = $response->error->message;
            } elseif (is_object($response->error->message)) {
                $message = $response->error->message->value;
            } else {
                $message = "Unknown error";
            }
            $error['Message'] = $message;
            return $error;
        }
        return null;
    }
private function extractError ( $ response ) { $ error = array ( ) ; $ response = json_decode ( $ response ) ; if ( property_exists ( $ response , 'error' ) ) { if ( is_string ( $ response -> error -> message ) ) { $ message = $ response -> error -> message ; } elseif ( is_object ( $ response -> error -> message ) ) { $ message = $ response -> error -> message -> value ; } else { $ message = "Unknown error" ; } $ error [ 'Message' ] = $ message ; return $ error ; } return null ; }
Extract error from JSON payload response
@param mixed $response
@return array
@throws Exception
Extract error from JSON payload response