From c37b0d815d222d000d2a220e929b488ecff665c3 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Fri, 14 Feb 2014 15:29:34 +0000
Subject: [PATCH]
---
opendj3-server-dev/src/server/org/opends/server/tools/upgrade/Upgrade.java | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/upgrade/Upgrade.java b/opendj3-server-dev/src/server/org/opends/server/tools/upgrade/Upgrade.java
index 350dd50..0a0f8d4 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/upgrade/Upgrade.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/upgrade/Upgrade.java
@@ -46,7 +46,10 @@
import javax.security.auth.callback.ConfirmationCallback;
import org.opends.server.core.LockFileManager;
-import org.opends.server.tools.ClientException;
+
+import com.forgerock.opendj.cli.ClientException;
+import com.forgerock.opendj.cli.ReturnCode;
+
import org.opends.server.util.BuildVersion;
import org.opends.server.util.StaticUtils;
@@ -452,7 +455,7 @@
{
final LocalizableMessage message = INFO_UPGRADE_ABORTED_BY_USER.get();
context.notify(message, WARNING);
- throw new ClientException(EXIT_CODE_ERROR, message);
+ throw new ClientException(ReturnCode.ERROR_UNEXPECTED, message);
}
try
@@ -503,7 +506,7 @@
{
final LocalizableMessage message = ERR_UPGRADE_TASKS_FAIL.get(e.getMessage());
context.notify(message, ERROR_CALLBACK);
- throw new ClientException(EXIT_CODE_ERROR, message);
+ throw new ClientException(ReturnCode.ERROR_UNEXPECTED, message);
}
finally
{
@@ -576,7 +579,7 @@
{
final LocalizableMessage message = ERR_UPGRADE_REQUIRES_SERVER_OFFLINE.get();
context.notify(message, NOTICE_CALLBACK);
- throw new ClientException(EXIT_CODE_ERROR, message);
+ throw new ClientException(ReturnCode.ERROR_UNEXPECTED, message);
}
}
finally
@@ -605,7 +608,7 @@
final LocalizableMessage message =
ERR_UPGRADE_VERSION_UP_TO_DATE.get(context.getToVersion());
context.notify(message, NOTICE_CALLBACK);
- throw new ClientException(EXIT_CODE_SUCCESS, message);
+ throw new ClientException(ReturnCode.SUCCESS, message);
}
// The upgrade only supports version >= 2.4.5.
@@ -614,7 +617,7 @@
final LocalizableMessage message = INFO_UPGRADE_VERSION_IS_NOT_SUPPORTED.get(
UPGRADESUPPORTSVERSIONFROM, UPGRADESUPPORTSVERSIONFROM);
context.notify(message, NOTICE_CALLBACK);
- throw new ClientException(EXIT_CODE_ERROR, message);
+ throw new ClientException(ReturnCode.ERROR_UNEXPECTED, message);
}
}
@@ -648,7 +651,7 @@
{
final LocalizableMessage message = LocalizableMessage.raw(e.getMessage());
context.notify(message, ERROR_CALLBACK);
- throw new ClientException(EXIT_CODE_ERROR, message);
+ throw new ClientException(ReturnCode.ERROR_UNEXPECTED, message);
}
finally
{
--
Gitblit v1.10.0