[Title] InstallManager can show fatal error message more specific than
authoryongsung1.kim <yongsung1.kim@samsung.com>
Wed, 31 Jul 2013 05:51:23 +0000 (14:51 +0900)
committeryongsung1.kim <yongsung1.kim@samsung.com>
Wed, 31 Jul 2013 05:51:23 +0000 (14:51 +0900)
before.
[Issue] redmine #10012

Change-Id: I20003d9cd6616b15add8dbf02b025b04de298c17

InstallManager_java/src/org/tizen/installmanager/core/Installer.java
InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java

index 6419b8f..6877163 100644 (file)
@@ -120,7 +120,8 @@ public class Installer {
 
                if (!executeInstallScript(pack, monitor, tempDir)) {
                        Log.err("Fail to execute install script.");
-                       throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR + " (" + pack + ")");
+                       throw new IMFatalException(ErrorController.getMessage(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR)
+                                       + " (" + pack + " package)");
                }
 
                if (!moveRemoveScript(tempDir, pack)) {
@@ -498,8 +499,8 @@ public class Installer {
                                        return executeScript(scriptFile);
                                } catch (IMShellCommandFail e) {
                                        Log.ExceptionLog(e);
-                                       throw new IMFatalException(
-                                                       ErrorCode.INSTALL_SCRIPT_FATAL_ERROR);
+                                       throw new IMFatalException(ErrorController.getMessage(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR)
+                                                       + " (" + pack + " package)");
                                }
                        } else {
                                Log.log(pack.getPackageName() + " does not have install script");
@@ -529,7 +530,8 @@ public class Installer {
                                }
                        } catch (IMShellCommandFail e) {
                                Log.ExceptionLog(e);
-                               throw new IMFatalException(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR + " (" + pkg + ")");
+                               throw new IMFatalException(ErrorController.getMessage(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR)
+                                               + " (" + pkg + " package)");
                        }
                }
                return 2; // package does not need remove script.
@@ -567,7 +569,8 @@ 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 + " (" + scriptFile.getParent() + ")");
+                       throw new IMFatalException(ErrorController.getMessage(ErrorCode.SCRIPT_FATAL_ERROR)
+                                       + " (" + scriptFile.getParentFile().getName() + " package)");
                }
        }
 }
index 79404d2..df410c2 100644 (file)
@@ -246,7 +246,8 @@ public class UninstallingPage extends PageTemplate {
                                                }
                                        } else {
                                                completePage.setTitle("Uninstallation Failed!");
-                                               completePage.setCustomErrorMessage("Sorry, Uninstallation was not success. Please try uninstall again.");
+                                               completePage.setCustomErrorMessage("Sorry, Uninstallation was not success. Please try uninstall again.\n"
+                                                               + "Datail : " + ErrorController.getErrorMessage());
                                        }
                                }
                        });