Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/extensions/EmailNotifications/vendor/async-aws/core/src/AwsError/JsonRestAwsErrorFactory.php
Ðазад
<?php namespace AsyncAws\Core\AwsError; use AsyncAws\Core\Exception\UnexpectedValue; use AsyncAws\Core\Exception\UnparsableResponse; final class JsonRestAwsErrorFactory implements AwsErrorFactoryInterface { use AwsErrorFactoryFromResponseTrait; public function createFromContent(string $content, array $headers): AwsError { try { $body = json_decode($content, true); return self::parseJson($body, $headers); } catch (\Throwable $e) { throw new UnparsableResponse('Failed to parse AWS error: ' . $content, 0, $e); } } /** * @param array<string, mixed> $body * @param array<string, list<string>> $headers */ private static function parseJson(array $body, array $headers): AwsError { $code = null; $type = $body['type'] ?? $body['Type'] ?? null; if ($type) { $type = strtolower($type); } $message = $body['message'] ?? $body['Message'] ?? null; if (isset($headers['x-amzn-errortype'][0])) { $code = explode(':', $headers['x-amzn-errortype'][0], 2)[0]; } if (null !== $code) { return new AwsError($code, $message, $type, null); } throw new UnexpectedValue('JSON does not contains AWS Error'); } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка