v2: Updates

* Simplifies & beautifies everything
* Introduces a new Class system.
* Errors are defaulted to AWS's handler.
* New function names & more efficient handling.
* Should fix a majority of the errors.

Please read the README for more!
This commit is contained in:
Devang Srivastava 2020-09-28 15:32:51 +05:30
commit e6d7753dc8
1095 changed files with 45088 additions and 2911 deletions

View file

@ -3,7 +3,6 @@ namespace Aws;
use Aws\Api\Parser\Exception\ParserException;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\FulfilledPromise;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
@ -74,7 +73,7 @@ class WrappedHttpHandler
$fn = $this->httpHandler;
$options = $command['@http'] ?: [];
$stats = [];
if ($this->collectStats) {
if ($this->collectStats || !empty($options['collect_stats'])) {
$options['http_stats_receiver'] = static function (
array $transferStats
) use (&$stats) {
@ -172,7 +171,11 @@ class WrappedHttpHandler
$parts = ['response' => null];
} else {
try {
$parts = call_user_func($this->errorParser, $err['response']);
$parts = call_user_func(
$this->errorParser,
$err['response'],
$command
);
$serviceError .= " {$parts['code']} ({$parts['type']}): "
. "{$parts['message']} - " . $err['response']->getBody();
} catch (ParserException $e) {