Handle NoSuchBucketException in S3
This commit is contained in:
parent
b6b3cd2d9b
commit
3e36de814d
@ -175,7 +175,7 @@ class S3CloudContentRepository extends InterceptingCloudContentRepository<S3Clou
|
||||
|
||||
@Override
|
||||
public String checkAuthenticationAndRetrieveCurrentAccount(S3Cloud cloud) throws BackendException {
|
||||
return this.cloud.currentAccount();
|
||||
return this.cloud.checkAuthenticationAndRetrieveCurrentAccount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -118,12 +118,6 @@ class S3Impl {
|
||||
return S3CloudNodeFactory.folder(parent, name, parent.getKey() + name);
|
||||
}
|
||||
|
||||
public void bucketExists() throws BackendException {
|
||||
if (!client().doesBucketExist(cloud.s3Bucket())) {
|
||||
throw new NoSuchBucketException(cloud.s3Bucket());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean exists(S3Node node) {
|
||||
String key = node.getKey();
|
||||
|
||||
@ -384,9 +378,14 @@ class S3Impl {
|
||||
}
|
||||
}
|
||||
|
||||
public String currentAccount() {
|
||||
public String checkAuthenticationAndRetrieveCurrentAccount() throws NoSuchBucketException {
|
||||
if (!client().doesBucketExist(cloud.s3Bucket())) {
|
||||
throw new NoSuchBucketException(cloud.s3Bucket());
|
||||
}
|
||||
|
||||
Owner currentAccount = client() //
|
||||
.getS3AccountOwner();
|
||||
|
||||
return currentAccount.getDisplayName();
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import org.cryptomator.domain.di.PerView
|
||||
import org.cryptomator.domain.exception.CloudAlreadyExistsException
|
||||
import org.cryptomator.domain.exception.CloudNodeAlreadyExistsException
|
||||
import org.cryptomator.domain.exception.NetworkConnectionException
|
||||
import org.cryptomator.domain.exception.NoSuchBucketException
|
||||
import org.cryptomator.domain.exception.NoSuchCloudFileException
|
||||
import org.cryptomator.domain.exception.UnableToDecryptWebdavPasswordException
|
||||
import org.cryptomator.domain.exception.VaultAlreadyExistException
|
||||
@ -45,6 +46,7 @@ class ExceptionHandlers @Inject constructor(private val context: Context, defaul
|
||||
staticHandler(NoLicenseAvailableException::class.java, R.string.dialog_enter_license_no_content)
|
||||
staticHandler(GeneralUpdateErrorException::class.java, R.string.error_general_update)
|
||||
staticHandler(SSLHandshakePreAndroid5UpdateCheckException::class.java, R.string.error_general_update)
|
||||
staticHandler(NoSuchBucketException::class.java, R.string.error_no_such_bucket)
|
||||
exceptionHandlers.add(MissingCryptorExceptionHandler())
|
||||
exceptionHandlers.add(CancellationExceptionHandler())
|
||||
exceptionHandlers.add(NoSuchVaultExceptionHandler())
|
||||
|
@ -33,6 +33,7 @@
|
||||
<string name="error_play_services_not_available">Play Services not installed</string>
|
||||
<string name="error_biometric_auth_aborted">Biometric authentication aborted</string>
|
||||
<string name="error_file_not_found_after_opening_using_3party">Local file isn\'t present anymore after switching back to Cryptomator. Possible changes cannot be propagated back to the cloud.</string>
|
||||
<string name="error_no_such_bucket">No such bucket</string>
|
||||
|
||||
<!-- # clouds -->
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user