diff --git a/src/main/java/org/elasticsearch/cloud/azure/AzureComputeServiceImpl.java b/src/main/java/org/elasticsearch/cloud/azure/AzureComputeServiceImpl.java index bd9f8495c6d..71372544973 100644 --- a/src/main/java/org/elasticsearch/cloud/azure/AzureComputeServiceImpl.java +++ b/src/main/java/org/elasticsearch/cloud/azure/AzureComputeServiceImpl.java @@ -117,11 +117,7 @@ public class AzureComputeServiceImpl extends AbstractLifecycleComponent instances = buildInstancesFromXml(stream, port_name); logger.trace("get instances from azure: {}", instances); return instances; - } catch (ParserConfigurationException e) { - logger.warn("can not parse XML response: {}", e.getMessage()); - } catch (XPathExpressionException e) { - logger.warn("can not parse XML response: {}", e.getMessage()); - } catch (SAXException e) { + } catch (ParserConfigurationException | XPathExpressionException | SAXException e) { logger.warn("can not parse XML response: {}", e.getMessage()); } catch (Exception e) { logger.warn("can not get list of azure nodes: {}", e.getMessage()); diff --git a/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobContainer.java b/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobContainer.java index 854552d7c7e..9b530ee977b 100644 --- a/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobContainer.java +++ b/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobContainer.java @@ -60,9 +60,7 @@ public class AzureBlobContainer extends AbstractBlobContainer { public boolean blobExists(String blobName) { try { return blobStore.client().blobExists(blobStore.container(), buildKey(blobName)); - } catch (URISyntaxException e) { - logger.warn("can not access [{}] in container {{}}: {}", blobName, blobStore.container(), e.getMessage()); - } catch (StorageException e) { + } catch (URISyntaxException | StorageException e) { logger.warn("can not access [{}] in container {{}}: {}", blobName, blobStore.container(), e.getMessage()); } return false; @@ -98,10 +96,7 @@ public class AzureBlobContainer extends AbstractBlobContainer { public void deleteBlob(String blobName) throws IOException { try { blobStore.client().deleteBlob(blobStore.container(), buildKey(blobName)); - } catch (URISyntaxException e) { - logger.warn("can not access [{}] in container {{}}: {}", blobName, blobStore.container(), e.getMessage()); - throw new IOException(e); - } catch (StorageException e) { + } catch (URISyntaxException | StorageException e) { logger.warn("can not access [{}] in container {{}}: {}", blobName, blobStore.container(), e.getMessage()); throw new IOException(e); } @@ -112,13 +107,7 @@ public class AzureBlobContainer extends AbstractBlobContainer { try { return blobStore.client().listBlobsByPrefix(blobStore.container(), keyPath, prefix); - } catch (URISyntaxException e) { - logger.warn("can not access [{}] in container {{}}: {}", prefix, blobStore.container(), e.getMessage()); - throw new IOException(e); - } catch (StorageException e) { - logger.warn("can not access [{}] in container {{}}: {}", prefix, blobStore.container(), e.getMessage()); - throw new IOException(e); - } catch (ServiceException e) { + } catch (URISyntaxException | StorageException | ServiceException e) { logger.warn("can not access [{}] in container {{}}: {}", prefix, blobStore.container(), e.getMessage()); throw new IOException(e); } diff --git a/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobStore.java b/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobStore.java index 4c4d21f757c..e68b69070a6 100644 --- a/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobStore.java +++ b/src/main/java/org/elasticsearch/cloud/azure/blobstore/AzureBlobStore.java @@ -76,11 +76,7 @@ public class AzureBlobStore extends AbstractComponent implements BlobStore { try { client.deleteFiles(container, keyPath); - } catch (URISyntaxException e) { - logger.warn("can not remove [{}] in container {{}}: {}", keyPath, container, e.getMessage()); - } catch (StorageException e) { - logger.warn("can not remove [{}] in container {{}}: {}", keyPath, container, e.getMessage()); - } catch (ServiceException e) { + } catch (URISyntaxException | StorageException | ServiceException e) { logger.warn("can not remove [{}] in container {{}}: {}", keyPath, container, e.getMessage()); } }