src/Guzzle/Service/Exception/CommandTransferException.php
public static function fromMultiTransferException(MultiTransferException $e)
    {
        $ce = new self($e->getMessage(), $e->getCode(), $e->getPrevious());
        $ce->setSuccessfulRequests($e->getSuccessfulRequests());

        $alreadyAddedExceptions = array();
        foreach ($e->getFailedRequests() as $request) {
            if ($re = $e->getExceptionForFailedRequest($request)) {
                $alreadyAddedExceptions[] = $re;
                $ce->addFailedRequestWithException($request, $re);
            } else {
                $ce->addFailedRequest($request);
            }
        }

        // Add any exceptions that did not map to a request
        if (count($alreadyAddedExceptions) < count($e)) {
            foreach ($e as $ex) {
                if (!in_array($ex, $alreadyAddedExceptions)) {
                    $ce->add($ex);
                }
            }
        }

        return $ce;
    }
public static function fromMultiTransferException(MultiTransferException $e)
    {
        $ce = new self($e->getMessage(), $e->getCode(), $e->getPrevious());
        $ce->setSuccessfulRequests($e->getSuccessfulRequests());

        $alreadyAddedExceptions = array();
        foreach ($e->getFailedRequests() as $request) {
            if ($re = $e->getExceptionForFailedRequest($request)) {
                $alreadyAddedExceptions[] = $re;
                $ce->addFailedRequestWithException($request, $re);
            } else {
                $ce->addFailedRequest($request);
            }
        }

        // Add any exceptions that did not map to a request
        if (count($alreadyAddedExceptions) < count($e)) {
            foreach ($e as $ex) {
                if (!in_array($ex, $alreadyAddedExceptions)) {
                    $ce->add($ex);
                }
            }
        }

        return $ce;
    }
public static function fromMultiTransferException ( MultiTransferException $ e ) { $ ce = new self ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e -> getPrevious ( ) ) ; $ ce -> setSuccessfulRequests ( $ e -> getSuccessfulRequests ( ) ) ; $ alreadyAddedExceptions = array ( ) ; foreach ( $ e -> getFailedRequests ( ) as $ request ) { if ( $ re = $ e -> getExceptionForFailedRequest ( $ request ) ) { $ alreadyAddedExceptions [ ] = $ re ; $ ce -> addFailedRequestWithException ( $ request , $ re ) ; } else { $ ce -> addFailedRequest ( $ request ) ; } } // Add any exceptions that did not map to a request if ( count ( $ alreadyAddedExceptions ) < count ( $ e ) ) { foreach ( $ e as $ ex ) { if ( ! in_array ( $ ex , $ alreadyAddedExceptions ) ) { $ ce -> add ( $ ex ) ; } } } return $ ce ; }
Creates a new CommandTransferException from a MultiTransferException

@param MultiTransferException $e Exception to base a new exception on

@return self
Creates a new CommandTransferException from a MultiTransferException