[Title] InstallManager can show fatal error message more specific than
authoryongsung1.kim <yongsung1.kim@samsung.com>
Tue, 30 Jul 2013 07:28:33 +0000 (16:28 +0900)
committeryongsung1.kim <yongsung1.kim@samsung.com>
Tue, 30 Jul 2013 07:28:33 +0000 (16:28 +0900)
before.
[Issue] redmine #10012

Change-Id: I72325f62262bab0bccaedd6cad053d83a9936633

InstallManager_java/src/org/tizen/installmanager/core/Installer.java
InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java

index 8a9da6d..6419b8f 100644 (file)
@@ -120,7 +120,7 @@ public class Installer {
 
                if (!executeInstallScript(pack, monitor, tempDir)) {
                        Log.err("Fail to execute install script.");
-                       throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR);
+                       throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR + " (" + pack + ")");
                }
 
                if (!moveRemoveScript(tempDir, pack)) {
@@ -529,7 +529,7 @@ public class Installer {
                                }
                        } catch (IMShellCommandFail e) {
                                Log.ExceptionLog(e);
-                               throw new IMFatalException(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR);
+                               throw new IMFatalException(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR + " (" + pkg + ")");
                        }
                }
                return 2; // package does not need remove script.
@@ -556,10 +556,7 @@ public class Installer {
                // check exit code
                if (exitCode == 0) {
                        return true;
-               } else if (exitCode == 1) {
-                       Log.err("Exit code => " + Integer.toString(exitCode));
-                       return false;
-               } else if (exitCode == 2) {
+               } else if (exitCode == 1 || exitCode == 2) {
                        Log.err("Exit code => " + Integer.toString(exitCode));
                        return false;
                } else if (exitCode == 99) {
@@ -570,7 +567,7 @@ public class Installer {
                        Log.err("Installer.executeScript() install script error => "
                                        + scriptFile.getAbsolutePath());
                        Log.err("Exit code => " + Integer.toString(exitCode));
-                       throw new IMFatalException(ErrorCode.SCRIPT_FATAL_ERROR);
+                       throw new IMFatalException(ErrorCode.SCRIPT_FATAL_ERROR + " (" + scriptFile.getParent() + ")");
                }
        }
 }
index b0670d9..b97d790 100644 (file)
@@ -78,7 +78,7 @@ public class ErrorController {
                OLD_TIZEN_SDK_EXISTS("Old Tizen SDK is installed. Remove the old SDK and run the Tizen SDK Install Manager again."),
                UNSUPPORTED_PLATFORM("Platform not supported."),
                REMOVE_SCRIPT_NOT_EXISTS("Removal script not found."),
-               REMOVE_SCRIPT_FATAL_ERROR("Fatal error occurred while uninstalling the Tizen SDK."),
+               REMOVE_SCRIPT_FATAL_ERROR("Fatal error occurred while executing remove script."),
                INSTALLATION_FAIL("Installation failed."),
                INSTALL_CANCELED("Installation canceled."),
                INSTALLED_VERSION_IS_HIGH("Installation progress failed due to high installed package version."),
@@ -101,7 +101,7 @@ public class ErrorController {
                PACKAGE_WRONG_CHECKSUM("Package file checksum error."),
                PACKAGE_NOT_EXIST_TO_INSTALL_OR_UNINSTALL("Install or uninstall package not found."),
                INSTALL_SCRIPT_NOT_EXISTS("Install script files not found."),
-               INSTALL_SCRIPT_FATAL_ERROR("Fatal error occurred while installing the Tizen SDK."),
+               INSTALL_SCRIPT_FATAL_ERROR("Fatal error occurred while executing install script."),
                SCRIPT_FATAL_ERROR("Fatal error occurred while executing post script."),
                
                // Network error