NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class ExceptionCollection

Collection of exceptions

  Exception
  Guzzle\Common\Exception\ExceptionCollection implements Guzzle\Common\Exception\GuzzleException, IteratorAggregate, Countable

### Direct known subclasses

`Guzzle\Http\Exception\MultiTransferException`

### Indirect known subclasses

`Guzzle\Service\Exception\CommandTransferException`

Namespace: Guzzle\Common\Exception
Located at Guzzle/Common/Exception/ExceptionCollection.php

## Methods summary

- `public` `__construct ( mixed $message = '', mixed $code = 0, Exception $previous = null )`
- `public` `setExceptions ( array $exceptions )`

  Set all of the exceptions

- `public` `add ( ExceptionCollection|\Exception $e )`

  Add exceptions to the collection

- `public` `count ( )`

  Get the total number of request exceptions

- `public` `getIterator ( )`

  Allows array-like iteration over the request exceptions

- `public` `getFirst ( )`

  Get the first exception in the collection

## Methods detail

# `public`
`__construct( mixed $message = '', mixed $code = 0, `Exception` $previous = null )`

#### Overrides

`Exception::__construct`
# `public `Guzzle\Common\Exception\ExceptionCollection``
`setExceptions( array $exceptions )`

Set all of the exceptions

#### Parameters

$exceptions
  `array`
  $exceptions Array of exceptions

#### Returns

``Guzzle\Common\Exception\ExceptionCollection``
# `public ExceptionCollection;`
`add( `Guzzle\Common\Exception\ExceptionCollection`|`Exception` $e )`

Add exceptions to the collection

#### Parameters

$e
  ``Guzzle\Common\Exception\ExceptionCollection`|`Exception``
  $e Exception to add

#### Returns

`ExceptionCollection;`
# `public integer`
`count( )`

Get the total number of request exceptions

#### Returns

`integer`

#### Implementation of

`Countable::count()`
# `public `ArrayIterator``
`getIterator( )`

Allows array-like iteration over the request exceptions

#### Returns

``ArrayIterator``

#### Implementation of

`IteratorAggregate::getIterator()`
# `public `Exception``
`getFirst( )`

Get the first exception in the collection

#### Returns

``Exception``

### Methods inherited from Exception

`__toString()`, `__wakeup()`, `getCode()`, `getFile()`, `getLine()`, `getMessage()`, `getPrevious()`, `getTrace()`, `getTraceAsString()`

### Magic methods summary

## Properties summary

`protected array` | $exceptions | # Array of Exceptions

### Properties inherited from Exception

`$code`, `$file`, `$line`, `$message`