parser = $parser; $this->exceptionClass = $exceptionClass; } public function __invoke( CommandInterface $command, ResponseInterface $response ) { $fn = $this->parser; try { return $fn($command, $response); } catch (ParserException $e) { throw new $this->exceptionClass( "Error parsing response for {$command->getName()}:" . " AWS parsing error: {$e->getMessage()}", $command, ['connection_error' => true, 'exception' => $e], $e ); } } public function parseMemberFromStream( StreamInterface $stream, StructureShape $member, $response ) { return $this->parser->parseMemberFromStream($stream, $member, $response); } }