Skip to content

Commit

Permalink
Better document the S3-specific parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeskew committed Sep 10, 2015
1 parent 0494e06 commit 4c68fa4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/S3/AmbiguousSuccessParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
use Aws\Exception\AwsException;
use Psr\Http\Message\ResponseInterface;

/**
* Converts errors returned with a status code of 200 to a retryable error type.
*
* @internal
*/
class AmbiguousSuccessParser extends AbstractParser
{
private static $ambiguousSuccesses = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
use Aws\Exception\AwsException;
use Psr\Http\Message\ResponseInterface;

class MalformedResponseParser extends AbstractParser
/**
* Converts malformed responses to a retryable error type.
*
* @internal
*/
class RetryableMalformedResponseParser extends AbstractParser
{
/** @var callable */
private $parser;
Expand Down
5 changes: 4 additions & 1 deletion src/S3/S3Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ public static function _applyApiProvider($value, array &$args, HandlerList $list
ClientResolver::_apply_api_provider($value, $args, $list);
$args['parser'] = new GetBucketLocationParser(
new AmbiguousSuccessParser(
new MalformedResponseParser($args['parser'], $args['exception_class']),
new RetryableMalformedResponseParser(
$args['parser'],
$args['exception_class']
),
$args['error_parser'],
$args['exception_class']
)
Expand Down

0 comments on commit 4c68fa4

Please sign in to comment.