mirror of
https://gitee.com/lxp135/minio-plus.git
synced 2025-12-07 17:38:23 +08:00
解决 sonar 扫描问题 InterruptedException 异常处理。
This commit is contained in:
parent
b9624c39fc
commit
e2050b4d33
@ -64,7 +64,11 @@ public class MinioS3ClientImpl implements MinioS3Client {
|
||||
try {
|
||||
return this.getClient().bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()).get();
|
||||
} catch (InsufficientDataException | InternalException | InvalidKeyException | IOException |
|
||||
NoSuchAlgorithmException | XmlParserException | ExecutionException | InterruptedException e) {
|
||||
NoSuchAlgorithmException | XmlParserException | ExecutionException e) {
|
||||
log.error("{}:{}", MinioPlusErrorCode.BUCKET_EXISTS_FAILED.getMessage(), e.getMessage(), e);
|
||||
throw new MinioPlusException(MinioPlusErrorCode.BUCKET_EXISTS_FAILED);
|
||||
} catch (InterruptedException e){
|
||||
Thread.currentThread().interrupt(); // 重新设置中断状态
|
||||
log.error("{}:{}", MinioPlusErrorCode.BUCKET_EXISTS_FAILED.getMessage(), e.getMessage(), e);
|
||||
throw new MinioPlusException(MinioPlusErrorCode.BUCKET_EXISTS_FAILED);
|
||||
}
|
||||
@ -226,9 +230,13 @@ public class MinioS3ClientImpl implements MinioS3Client {
|
||||
.build());
|
||||
|
||||
} catch (InsufficientDataException | InternalException | InvalidKeyException | IOException |
|
||||
NoSuchAlgorithmException | XmlParserException | ExecutionException | InterruptedException e) {
|
||||
NoSuchAlgorithmException | XmlParserException | ExecutionException e) {
|
||||
log.error(MinioPlusErrorCode.WRITE_FAILED.getMessage(), e);
|
||||
throw new MinioPlusException(MinioPlusErrorCode.WRITE_FAILED);
|
||||
} catch (InterruptedException e){
|
||||
Thread.currentThread().interrupt(); // 重新设置中断状态
|
||||
log.error("{}:{}", MinioPlusErrorCode.BUCKET_EXISTS_FAILED.getMessage(), e.getMessage(), e);
|
||||
throw new MinioPlusException(MinioPlusErrorCode.BUCKET_EXISTS_FAILED);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user