Enhance error handling in S3 access denied

This commit is contained in:
Julian Raufelder 2021-05-12 15:11:03 +02:00
parent fe96e1ad64
commit 60e7a025a0
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -6,6 +6,7 @@ import org.cryptomator.data.cloud.InterceptingCloudContentRepository;
import org.cryptomator.domain.S3Cloud;
import org.cryptomator.domain.exception.BackendException;
import org.cryptomator.domain.exception.FatalBackendException;
import org.cryptomator.domain.exception.ForbiddenException;
import org.cryptomator.domain.exception.NetworkConnectionException;
import org.cryptomator.domain.exception.NoSuchBucketException;
import org.cryptomator.domain.exception.authentication.WrongCredentialsException;
@ -62,6 +63,8 @@ class S3CloudContentRepository extends InterceptingCloudContentRepository<S3Clou
if (S3CloudApiExceptions.isAccessProblem(errorCode)) {
throw new WrongCredentialsException(cloud);
}
} else if(e instanceof ForbiddenException) {
throw new WrongCredentialsException(cloud);
}
}