Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"description" : "AWS Core for the XP Framework",
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^12.0 | ^11.0 | ^10.14",
"xp-framework/core": "^12.11 | ^11.11",
"xp-framework/http": "^11.0 | ^10.0 | ^9.0",
"xp-framework/networking": "^11.1",
"xp-forge/json": "^6.0 | ^5.0",
"xp-forge/marshalling": "^2.0 | ^1.0",
"php": ">=7.4.0"
Expand Down
4 changes: 2 additions & 2 deletions src/main/php/com/amazon/aws/ServiceEndpoint.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function sign($target, int $expires= 3600, $time= null): string {
/**
* Opens a request and returns a `Transfer` instance for writing data to
*
* @throws io.IOException
* @throws io.OperationFailed
*/
public function open(string $method, $target, array $headers, $hash= null, $time= null): Transfer {
$signature= new SignatureV4($this->credentials());
Expand Down Expand Up @@ -263,7 +263,7 @@ public function open(string $method, $target, array $headers, $hash= null, $time
/**
* Sends a request and returns the response
*
* @throws io.IOException
* @throws io.OperationFailed
*/
public function request(string $method, $target, array $headers= [], $payload= null, $time= null): Response {
if (null === $payload) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/php/com/amazon/aws/credentials/FromSSO.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace com\amazon\aws\credentials;

use com\amazon\aws\Credentials;
use io\{File, Path, IOException};
use io\{File, Path, OperationFailed};
use lang\{Environment, IllegalStateException};
use peer\AuthenticationException;
use peer\http\{HttpConnection, RequestData};
Expand Down Expand Up @@ -71,8 +71,8 @@ private function refresh($cache) {
'X-Amz-User-Agent' => $this->userAgent,
'Content-Type' => self::JSON,
]);
} catch (IOException $t) {
throw new IllegalStateException("OIDC refreshing via {$this->refresh->getUrl()->getURL()} failed", $t);
} catch (OperationFailed $e) {
throw new IllegalStateException("OIDC refreshing via {$this->refresh->getUrl()->getURL()} failed", $e);
}

if (200 !== $res->statusCode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use com\amazon\aws\credentials\{FromGiven, FromEnvironment, FromConfig, FromEcs, FromSSO};
use com\amazon\aws\{Credentials, CredentialProvider};
use io\{TempFile, IOException};
use io\TempFile;
use lang\IllegalStateException;
use peer\AuthenticationException;
use peer\{AuthenticationException, ConnectException};
use test\{Assert, Expect, Test, Values};
use text\json\{Json, FileInput};
use util\NoSuchElementException;
Expand Down Expand Up @@ -370,7 +370,7 @@ public function ecs_api_error_raises_exception() {
public function ecs_api_failing_raises_exception() {
with (new Exported(['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' => '/get-credentials']), function() {
$conn= new TestConnection(['/get-credentials' => function($req) {
throw new IOException('Connection failed');
throw new ConnectException('Connection failed');
}]);
(new FromEcs($conn))->credentials();
});
Expand Down
Loading