OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
zzaws-ses
/
vendor
/
aws
/
aws-sdk-php
/
src
/
Api
/
ErrorParser
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 08:00:23 AM
rwxr-xr-x
📄
AbstractErrorParser.php
2.99 KB
08/14/2024 08:00:22 AM
rw-r--r--
📄
JsonParserTrait.php
1.61 KB
08/14/2024 08:00:22 AM
rw-r--r--
📄
JsonRpcErrorParser.php
1.31 KB
08/14/2024 08:00:22 AM
rw-r--r--
📄
RestJsonErrorParser.php
1.63 KB
08/14/2024 08:00:22 AM
rw-r--r--
📄
XmlErrorParser.php
3.2 KB
08/14/2024 08:00:22 AM
rw-r--r--
Editing: JsonRpcErrorParser.php
Close
<?php namespace Aws\Api\ErrorParser; use Aws\Api\Parser\JsonParser; use Aws\Api\Service; use Aws\CommandInterface; use Psr\Http\Message\ResponseInterface; /** * Parsers JSON-RPC errors. */ class JsonRpcErrorParser extends AbstractErrorParser { use JsonParserTrait; private $parser; public function __construct(Service $api = null, JsonParser $parser = null) { parent::__construct($api); $this->parser = $parser ?: new JsonParser(); } public function __invoke( ResponseInterface $response, CommandInterface $command = null ) { $data = $this->genericHandler($response); // Make the casing consistent across services. if ($data['parsed']) { $data['parsed'] = array_change_key_case($data['parsed']); } if (isset($data['parsed']['__type'])) { if (!isset($data['code'])) { $parts = explode('#', $data['parsed']['__type']); $data['code'] = isset($parts[1]) ? $parts[1] : $parts[0]; } $data['message'] = isset($data['parsed']['message']) ? $data['parsed']['message'] : null; } $this->populateShape($data, $response, $command); return $data; } }