modules/common/cassandra-installer/pom.xml | 2
modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java | 24 ++++++----
2 files changed, 16 insertions(+), 10 deletions(-)
New commits:
commit 10ebd20b9ec54d734e038f75c4043433d71545a9
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Oct 1 11:13:50 2013 -0500
[BZ 1010265] One more update to align the exception handling with the current storage installer exception and error mechanism. The error handling is now local to where it occurs.
diff --git a/modules/common/cassandra-installer/pom.xml b/modules/common/cassandra-installer/pom.xml
index 46d2035..0524802 100644
--- a/modules/common/cassandra-installer/pom.xml
+++ b/modules/common/cassandra-installer/pom.xml
@@ -123,7 +123,7 @@
<id>dev</id>
<properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.rootDir>../../..</rhq.rootDir>
<rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
<rhq.deploymentDir>${rhq.containerDir}/modules/org/rhq/rhq-cassandra-installer/main</rhq.deploymentDir>
</properties>
diff --git a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index 29aa8d4..abf57e3 100644
--- a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++ b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -104,6 +104,8 @@ public class StorageInstaller {
public static final int STATUS_GOSSIP_PORT_CONFLICT = 10;
+ public static final int STATUS_UNKNOWN_HOST = 11;
+
private final String STORAGE_BASEDIR = "rhq-storage";
private final Log log = LogFactory.getLog(StorageInstaller.class);
@@ -437,8 +439,12 @@ public class StorageInstaller {
deployer.updateStorageAuthConf(addresses);
return installerInfo;
+ } catch (UnknownHostException unknownHostException) {
+ throw new StorageInstallerException(
+ "Failed to resolve requested binding address. Please check the installation instructions and host DNS settings. Unknown host "
+ + unknownHostException.getMessage(), unknownHostException, STATUS_UNKNOWN_HOST);
} catch (IOException e) {
- throw new StorageInstallerException("The upgrade cannot proceed. An unexpected I/O error occurred", e,
+ throw new StorageInstallerError("The upgrade cannot proceed. An unexpected I/O error occurred", e,
STATUS_IO_ERROR);
} catch (DeploymentException e) {
throw new StorageInstallerException("The installation cannot proceed. An error occurred during storage "
@@ -549,12 +555,17 @@ public class StorageInstaller {
deployer.updateStorageAuthConf(addresses);
return installerInfo;
+
+ } catch (UnknownHostException unknownHostException) {
+ throw new StorageInstallerException(
+ "Failed to resolve requested binding address. Please check the installation instructions and host DNS settings. Unknown host "
+ + unknownHostException.getMessage(), unknownHostException, STATUS_UNKNOWN_HOST);
+ } catch (IOException e) {
+ throw new StorageInstallerError("The upgrade cannot proceed. An unexpected I/O error occurred", e,
+ STATUS_IO_ERROR);
} catch (DeploymentException e) {
throw new StorageInstallerException("THe upgrade cannot proceed. An error occurred during the storage "
+ "node deployment", e, STATUS_DEPLOYMENT_ERROR);
- } catch (IOException e) {
- throw new StorageInstallerException("The upgrade cannot proceed. An unexpected I/O error occurred", e,
- STATUS_IO_ERROR);
}
}
@@ -935,11 +946,6 @@ public class StorageInstaller {
CommandLine cmdLine = parser.parse(installer.getOptions(), args);
int status = installer.run(cmdLine);
System.exit(status);
- } catch (UnknownHostException unknownHostException) {
- installer.log
- .error("Failed to resolve requested binding address. Please check the installation instructions and host DNS settings. "
- + unknownHostException.getMessage());
- throw unknownHostException;
} catch (ParseException parseException) {
installer.printUsage();
System.exit(STATUS_SHOW_USAGE);