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

# Class ErrorResponsePlugin

Converts generic Guzzle response exceptions into errorResponse exceptions

  Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin implements Symfony\Component\EventDispatcher\EventSubscriberInterface

Namespace: Guzzle\Plugin\ErrorResponse
Located at Guzzle/Plugin/ErrorResponse/ErrorResponsePlugin.php

## Methods summary

- `public static` `getSubscribedEvents ( )`
- `public` `onCommandBeforeSend ( Guzzle\Common\Event $event )`

  Adds a listener to requests before they sent from a command

- `protected` `getErrorClosure ( Guzzle\Http\Message\RequestInterface $request, Guzzle\Service\Command\CommandInterface $command, Guzzle\Service\Description\Operation $operation )`

## Methods detail

# `public static`
`getSubscribedEvents( )`
# `public`
`onCommandBeforeSend( `Guzzle\Common\Event` $event )`

Adds a listener to requests before they sent from a command

#### Parameters

$event
  ``Guzzle\Common\Event``
  $event Event emitted

# `protected `Closure``
`getErrorClosure( `Guzzle\Http\Message\RequestInterface` $request, `Guzzle\Service\Command\CommandInterface` $command, `Guzzle\Service\Description\Operation` $operation )`

#### Parameters

$request
  ``Guzzle\Http\Message\RequestInterface``
  $request Request that received an error
$command
  ``Guzzle\Service\Command\CommandInterface``
  $command Command that created the request
$operation
  ``Guzzle\Service\Description\Operation``
  $operation Operation that defines the request and errors

#### Returns

``Closure``
Returns a closure

#### Throws

``Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException``

### Magic methods summary