From d3202f24f6b80839fcdca3412f89023bbced8b96 Mon Sep 17 00:00:00 2001 From: David Tchekachev Date: Sun, 13 Jul 2025 23:28:23 +0200 Subject: [PATCH] fix(s3.client): catch AWS `UnresolvedAuthSchemeException` when testing connection https://github.com/catalyst/moodle-tool_objectfs/issues/685 --- classes/local/store/s3/client.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/local/store/s3/client.php b/classes/local/store/s3/client.php index d1d6a389..72bd8931 100644 --- a/classes/local/store/s3/client.php +++ b/classes/local/store/s3/client.php @@ -321,6 +321,9 @@ public function test_connection() { } else { $this->client->headBucket(['Bucket' => $this->bucket]); } + } catch (\Aws\Auth\Exception\UnresolvedAuthSchemeException $e) { + $connection->success = false; + $connection->details = $this->get_exception_details($e); } catch (\Aws\S3\Exception\S3Exception $e) { $connection->success = false; $connection->details = $this->get_exception_details($e);