Skip to content

Commit

Permalink
improve exception with createBucket
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 4, 2023
1 parent c636e3d commit da60edc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions source/java/src/org/lucee/extension/resource/s3/S3.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,11 @@ public Bucket createDirectory(String bucketName, Object acl, String targetRegion
if (expectedRegion != null && !expectedRegion.equalsIgnoreCase(defaultRegion)) {
client = getAmazonS3(null, expectedRegion);
b = client.createBucket(cbr);
return b;
}
}
else {
if (!Util.isEmpty(targetRegion)) throw new S3Exception("could not create bucket [" + bucketName + "] with defined region [" + targetRegion + "]", ase);
throw new S3Exception("could not create bucket [" + bucketName + "] with region [" + region + "]", ase);
}
if (!Util.isEmpty(targetRegion)) throw new S3Exception("could not create bucket [" + bucketName + "] with defined region [" + targetRegion + "]", ase);
throw new S3Exception("could not create bucket [" + bucketName + "] with region [" + region + "]", ase);
}
finally {
client.release();
Expand Down

0 comments on commit da60edc

Please sign in to comment.