src/Guzzle/Plugin/ErrorResponse/ErrorResponsePlugin.php
public function onCommandBeforeSend(Event $event)
    {
        $command = $event['command'];
        if ($operation = $command->getOperation()) {
            if ($operation->getErrorResponses()) {
                $request = $command->getRequest();
                $request->getEventDispatcher()
                    ->addListener('request.complete', $this->getErrorClosure($request, $command, $operation));
            }
        }
    }
public function onCommandBeforeSend(Event $event)
    {
        $command = $event['command'];
        if ($operation = $command->getOperation()) {
            if ($operation->getErrorResponses()) {
                $request = $command->getRequest();
                $request->getEventDispatcher()
                    ->addListener('request.complete', $this->getErrorClosure($request, $command, $operation));
            }
        }
    }
public function onCommandBeforeSend ( Event $ event ) { $ command = $ event [ 'command' ] ; if ( $ operation = $ command -> getOperation ( ) ) { if ( $ operation -> getErrorResponses ( ) ) { $ request = $ command -> getRequest ( ) ; $ request -> getEventDispatcher ( ) -> addListener ( 'request.complete' , $ this -> getErrorClosure ( $ request , $ command , $ operation ) ) ; } } }
Adds a listener to requests before they sent from a command

@param Event $event Event emitted
Adds a listener to requests before they sent from a command