Skip to content

Commit d936937

Browse files
committed
handle error
1 parent 2ea0c59 commit d936937

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

s3compatapi/src/main/java/com/snowflake/s3compatapitestsuite/compatapi/S3CompatStorageClient.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ public String getBucketLocation(String bucketName) {
9898
if (ex.getAdditionalDetails() != null) {
9999
String correctRegion = ex.getAdditionalDetails().get("Region");
100100
if (correctRegion != null) {
101-
this.s3Client.setSignerRegionOverride(correctRegion);
102-
this.s3Client.setRegion(RegionUtils.getRegion(correctRegion));
103101
return correctRegion.toLowerCase();
104102
}
105103
}
@@ -120,10 +118,8 @@ public String getBucketRegionThroughMetadata(String bucketName) {
120118
}
121119
} catch (AmazonS3Exception ex) {
122120
if (ex.getAdditionalDetails() != null) {
123-
String correctRegion = ex.getAdditionalDetails().get("Region");
121+
String correctRegion = ex.getAdditionalDetails().get(BUCKET_REGION_HEADER_NAME);
124122
if (correctRegion != null) {
125-
this.s3Client.setSignerRegionOverride(correctRegion);
126-
this.s3Client.setRegion(RegionUtils.getRegion(correctRegion));
127123
return correctRegion.toLowerCase();
128124
}
129125
}

0 commit comments

Comments
 (0)