diff --git a/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java b/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java index 4c4ce2af0aa..a0006e61883 100644 --- a/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java +++ b/s3/src/main/java/ch/cyberduck/core/s3/S3Session.java @@ -36,9 +36,7 @@ import ch.cyberduck.core.cloudfront.CloudFrontDistributionConfigurationPreloader; import ch.cyberduck.core.cloudfront.WebsiteCloudFrontDistributionConfiguration; import ch.cyberduck.core.date.RFC822DateFormatter; -import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; -import ch.cyberduck.core.exception.InteroperabilityException; import ch.cyberduck.core.exception.LoginCanceledException; import ch.cyberduck.core.features.*; import ch.cyberduck.core.http.CustomServiceUnavailableRetryStrategy; @@ -51,7 +49,6 @@ import ch.cyberduck.core.preferences.PreferencesReader; import ch.cyberduck.core.proxy.ProxyFinder; import ch.cyberduck.core.restore.Glacier; -import ch.cyberduck.core.shared.DefaultHomeFinderService; import ch.cyberduck.core.shared.DefaultPathHomeFeature; import ch.cyberduck.core.shared.DelegatingHomeFeature; import ch.cyberduck.core.shared.DisabledBulkFeature; @@ -364,32 +361,23 @@ public void login(final LoginCallback prompt, final CancelCallback cancel) throw } } else { - try { - final Path home = new DelegatingHomeFeature(new DefaultPathHomeFeature(host)).find(); - if(home.isRoot()) { - if(log.isDebugEnabled()) { - log.debug(String.format("Skip querying region for %s", home)); - } - } - else { - final Location.Name location = new S3LocationFeature(S3Session.this, regions).getLocation(home); - if(log.isDebugEnabled()) { - log.debug(String.format("Retrieved region %s", location)); - } - if(!Location.unknown.equals(location)) { - if(log.isDebugEnabled()) { - log.debug(String.format("Set default region to %s determined from %s", location, home)); - } - // - host.setProperty("s3.location", location.getIdentifier()); - } + final Path home = new DelegatingHomeFeature(new DefaultPathHomeFeature(host)).find(); + if(home.isRoot()) { + if(log.isDebugEnabled()) { + log.debug(String.format("Skip querying region for %s", home)); } } - catch(AccessDeniedException | InteroperabilityException e) { - log.warn(String.format("Failure %s querying region", e)); - final Path home = new DefaultHomeFinderService(this).find(); + else { + final Location.Name location = new S3LocationFeature(this, regions).getLocation(home); if(log.isDebugEnabled()) { - log.debug(String.format("Retrieved %s", home)); + log.debug(String.format("Retrieved region %s", location)); + } + if(!Location.unknown.equals(location)) { + if(log.isDebugEnabled()) { + log.debug(String.format("Set default region to %s determined from %s", location, home)); + } + // + host.setProperty("s3.location", location.getIdentifier()); } } }