From 8b763ea0f7e87d2b38ff1a1dcd97832ef94c93c5 Mon Sep 17 00:00:00 2001
From: Morris Jobke <hey@morrisjobke.de>
Date: Mon, 6 Nov 2017 09:48:41 +0100
Subject: [PATCH] Better error message for invalid bucket names

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
---
 lib/private/Files/ObjectStore/S3ConnectionTrait.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index fdda19ff700..927d93689c7 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -90,8 +90,8 @@ trait S3ConnectionTrait {
 		}
 		$this->connection = new S3Client($options);
 
-		if (!S3Client::isBucketDnsCompatible($this->bucket)) {
-			throw new \Exception("The configured bucket name is invalid.");
+		if (!$this->connection->isBucketDnsCompatible($this->bucket)) {
+			throw new \Exception("The configured bucket name is invalid: " . $this->bucket);
 		}
 
 		if (!$this->connection->doesBucketExist($this->bucket)) {
-- 
GitLab