src/Utility/IntuitErrorHandler.php
public static function HandleErrorsXml($responseXml)
    {
        $errCodeNode = $responseXml->{UtilityConstants::ERRCODEXPATH};

        if ($errCodeNode == null) {
            return;
        }

        if ((int)$errCodeNode) {
            throw new IdsException('HandleErrors error code (UtilityConstants::ERRCODEXPATH): '.(int)$errCodeNode);
        }

        $errTextNode = $responseXml->{UtilityConstants::ERRTEXTXPATH};
        if ($errTextNode == null) {
            throw new IdsException('HandleErrors error code (UtilityConstants::ERRTEXTXPATH): '.(int)$errCodeNode);
        }

        $errorText = (string)$errTextNode;
        $errDetailNode = $responseXml->{UtilityConstants::ERRDETAILXPATH};
        $errorDetail = $errDetailNode != null ? (string)$errDetailNode : null;

        if (!$errorDetail) {
            throw new IdsException('HandleErrors error code (UtilityConstants::ERRDETAILXPATH): '.(string)$errorDetail);
        }

        throw new IdsException('HandleErrors error code: '.$errorText);
    }
public static function HandleErrorsXml($responseXml)
    {
        $errCodeNode = $responseXml->{UtilityConstants::ERRCODEXPATH};

        if ($errCodeNode == null) {
            return;
        }

        if ((int)$errCodeNode) {
            throw new IdsException('HandleErrors error code (UtilityConstants::ERRCODEXPATH): '.(int)$errCodeNode);
        }

        $errTextNode = $responseXml->{UtilityConstants::ERRTEXTXPATH};
        if ($errTextNode == null) {
            throw new IdsException('HandleErrors error code (UtilityConstants::ERRTEXTXPATH): '.(int)$errCodeNode);
        }

        $errorText = (string)$errTextNode;
        $errDetailNode = $responseXml->{UtilityConstants::ERRDETAILXPATH};
        $errorDetail = $errDetailNode != null ? (string)$errDetailNode : null;

        if (!$errorDetail) {
            throw new IdsException('HandleErrors error code (UtilityConstants::ERRDETAILXPATH): '.(string)$errorDetail);
        }

        throw new IdsException('HandleErrors error code: '.$errorText);
    }
Check the response for any errors it might indicate. Will throw an exception if API response indicates an error.
Will throw an exception if it has a problem determining success or error.
@param SimpleXMLElement responseXml