Catch a generic Exception in MetadataApi
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3a31c1c9 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3a31c1c9 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3a31c1c9 Branch: refs/heads/release-4.1.5 Commit: 3a31c1c9e52dbcbdbb934e6db90b0078888fe403 Parents: 452c31f Author: Akila Perera <[email protected]> Authored: Mon Nov 30 00:21:10 2015 +0530 Committer: gayangunarathne <[email protected]> Committed: Mon Dec 7 10:16:26 2015 +0000 ---------------------------------------------------------------------- .../stratos/metadata/service/api/MetadataApi.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/3a31c1c9/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/api/MetadataApi.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/api/MetadataApi.java b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/api/MetadataApi.java index 53174e0..053e030 100644 --- a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/api/MetadataApi.java +++ b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/api/MetadataApi.java @@ -68,7 +68,7 @@ public class MetadataApi { propertiesArr = new Property[properties.size()]; propertiesArr = properties.toArray(propertiesArr); } - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Error occurred while getting properties "; log.error(msg, e); throw new RestAPIException(msg, e); @@ -98,7 +98,7 @@ public class MetadataApi { propertiesArr = new Property[properties.size()]; propertiesArr = properties.toArray(propertiesArr); } - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Error occurred while getting properties "; log.error(msg, e); throw new RestAPIException(msg, e); @@ -133,7 +133,7 @@ public class MetadataApi { break; } } - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Error occurred while getting property"; log.error(msg, e); throw new RestAPIException(msg, e); @@ -169,7 +169,7 @@ public class MetadataApi { break; } } - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Error occurred while getting property"; log.error(msg, e); throw new RestAPIException(msg, e); @@ -194,7 +194,7 @@ public class MetadataApi { try { registry.addPropertyToApplication(applicationId, property); - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Error occurred while adding properties "; log.error(msg, e); throw new RestAPIException(msg, e); @@ -212,7 +212,7 @@ public class MetadataApi { try { registry.addPropertyToCluster(applicationId, clusterId, property); - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Error occurred while adding properties "; log.error(msg, e); throw new RestAPIException(msg, e); @@ -232,7 +232,7 @@ public class MetadataApi { if (!deleted) { log.warn(String.format("No metadata is associated with given appId %s", applicationId)); } - } catch (RegistryException e) { + } catch (Exception e) { String msg = "Resource attached with appId could not be deleted [application-id] " + applicationId; log.error(msg, e); throw new RestAPIException(msg, e); @@ -252,7 +252,7 @@ public class MetadataApi { if (!deleted) { log.warn(String.format("No metadata is associated with given appId %s", applicationId)); } - } catch (RegistryException e) { + } catch (Exception e) { String msg = String .format("[application-id] %s [property-name] %s deletion failed ", applicationId, propertyName); log.error(msg, e); @@ -274,7 +274,7 @@ public class MetadataApi { if (!deleted) { log.warn(String.format("No metadata is associated with given [application-id] %s", applicationId)); } - } catch (RegistryException e) { + } catch (Exception e) { String msg = String .format("[application-id] %s [property-name] %s [value] %s deletion failed" + applicationId, propertyName, propertyValue);
