StackFormation\Helper\Exception::extractMessage PHP Method

extractMessage() public static method

public static extractMessage ( Aws\CloudFormation\Exception\CloudFormationException $exception )
$exception Aws\CloudFormation\Exception\CloudFormationException
    public static function extractMessage(\Aws\CloudFormation\Exception\CloudFormationException $exception)
    {
        $message = (string) $exception->getResponse()->getBody();
        $xml = simplexml_load_string($message);
        if ($xml !== false && $xml->Error->Message) {
            return $xml->Error->Message;
        }
        return $exception->getMessage();
    }