Installer errors handling clean up
authorTomasz Iwanek <t.iwanek@samsung.com>
Tue, 12 Feb 2013 15:27:45 +0000 (16:27 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Thu, 28 Feb 2013 14:01:34 +0000 (15:01 +0100)
[Issue#]       LINUXWRT-100
[Bug]          Unused error code, too much code error enums in overall
[Cause]        Development
[Solution]     Error handling will be clean up.

Error handling of installer after modifications will look in following way:
-    each job declares it's on exceptions (DECLARE_JOB_EXCEPTION) that can be used in it's tasks (jobs/(job)/(job)_errors.h),
-    each exception have associated enum Exceptions::Type value (many exceptions can have same value),
-    Exceptions::Type enum value is translated into (general for installer) WrtErrStatus error code (wrt_type.h),
-    WrtErrStatus is used into installation callbacks and decides about information for user,

Any other error handling (in installer code) should be removed after all.

[Verification] Build repository

Change-Id: Id0b94f3c1f98f30e8dbbc80f2046a83272cb2d43

src/jobs/plugin_install/plugin_installer_errors.h
src/jobs/widget_install/task_certify.cpp
src/jobs/widget_install/task_widget_config.cpp
src/jobs/widget_install/task_widget_config.h
src/jobs/widget_install/widget_install_errors.h
src/wrt-installer/installer_callbacks_translate.cpp
src/wrt-installer/installer_callbacks_translate.h
src/wrt-installer/wrt_installer.cpp
src/wrt-installer/wrt_type.h

index 73132f0..16ad13f 100644 (file)
@@ -35,9 +35,9 @@ enum Type
 {
     Success,                    ///< Success
 
-    WrongPluginPath,            ///< ?
-    MetafileError,              ///< ?
-    AlreadyInstalled,           ///< ?
+    WrongPluginPath,            ///< Wrong plugin path
+    MetafileError,              ///< Metafile parse error
+    AlreadyInstalled,           ///< Plugin already installed
     LoadingLibraryError,        ///< Loading library by dlopen failed.
                                 /// It may be caused by missing symbols
     InstallationWaiting,         /// Installation failed due to dependencies
index 578e88c..6b0040f 100644 (file)
@@ -33,7 +33,6 @@
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/widget_install_context.h>
 #include <dpl/log/log.h>
-#include <wrt_error.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 #include "wac_widget_id.h"
 
index d4702f8..74b006d 100644 (file)
@@ -44,7 +44,6 @@
 #include <widget_install/widget_install_context.h>
 #include <widget_install/widget_install_errors.h>
 #include <widget_parser.h>
-#include <wrt_error.h>
 
 namespace { // anonymous
 const DPL::String BR = DPL::FromUTF8String("<br>");
@@ -647,9 +646,7 @@ bool TaskWidgetConfig::isTizenWebApp() const
 
 bool TaskWidgetConfig::parseConfigurationFileBrowser(
     WrtDB::ConfigParserData& configInfo,
-    const std::string&
-    _currentPath,
-    int* pErrCode)
+    const std::string& _currentPath)
 {
     ParserRunner parser;
     Try
@@ -664,7 +661,6 @@ bool TaskWidgetConfig::parseConfigurationFileBrowser(
     Catch(ElementParser::Exception::Base)
     {
         LogError("Invalid widget configuration file!");
-        *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
         return false;
     }
     return true;
@@ -672,9 +668,7 @@ bool TaskWidgetConfig::parseConfigurationFileBrowser(
 
 bool TaskWidgetConfig::parseConfigurationFileWidget(
     WrtDB::ConfigParserData& configInfo,
-    const std::string&
-    _currentPath,
-    int* pErrCode)
+    const std::string& _currentPath)
 {
     ParserRunner parser;
 
@@ -684,7 +678,6 @@ bool TaskWidgetConfig::parseConfigurationFileWidget(
 
     dir = opendir(_currentPath.c_str());
     if (dir == NULL) {
-        *pErrCode = WRT_ERR_UNKNOWN;
         return false;
     }
     bool has_config_xml = false;
@@ -720,8 +713,6 @@ bool TaskWidgetConfig::parseConfigurationFileWidget(
                 Catch(ElementParser::Exception::Base)
                 {
                     LogError("Invalid widget configuration file!");
-                    //                    _rethrown_exception.Dump();
-                    *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
                     if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
                         LogError(
                             "Failed to close dir: " << _currentPath <<
@@ -748,7 +739,6 @@ bool TaskWidgetConfig::parseConfigurationFileWidget(
     //We must have config.xml so leaveing if we doesn't
     if (!has_config_xml) {
         LogError("Invalid archive");
-        *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
         return false;
     }
     return true;
@@ -757,15 +747,10 @@ bool TaskWidgetConfig::parseConfigurationFileWidget(
 bool TaskWidgetConfig::locateAndParseConfigurationFile(
     const std::string& _currentPath,
     WrtDB::WidgetRegisterInfo& pWidgetConfigInfo,
-    const std::string& baseFolder,
-    int* pErrCode)
+    const std::string& baseFolder)
 {
     using namespace WrtDB;
 
-    if (!pErrCode) {
-        return false;
-    }
-
     ConfigParserData& configInfo = pWidgetConfigInfo.configInfo;
 
     // check if this installation from browser, or not.
@@ -775,26 +760,22 @@ bool TaskWidgetConfig::locateAndParseConfigurationFile(
 
     if (infoPath.str() != WRT_WIDGET_CONFIG_FILE_NAME) {
         if (_currentPath.empty() || baseFolder.empty()) {
-            *pErrCode = WRT_ERR_INVALID_ARG;
             return false;
         }
         // in case of general installation using wgt archive
-        if (!parseConfigurationFileWidget(configInfo, _currentPath,
-                                          pErrCode))
+        if (!parseConfigurationFileWidget(configInfo, _currentPath))
         {
             return false;
         }
     } else {
         // in case of browser installation
-        if (!parseConfigurationFileBrowser(configInfo, _currentPath,
-                                           pErrCode))
+        if (!parseConfigurationFileBrowser(configInfo, _currentPath))
         {
             return false;
         }
     }
 
     if (!fillWidgetConfig(pWidgetConfigInfo, configInfo)) {
-        *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
         return false;
     }
     return true;
@@ -851,10 +832,8 @@ void TaskWidgetConfig::processFile(
     WrtDB::WidgetRegisterInfo &
     widgetConfiguration)
 {
-    int pErrCode;
-
     if (!locateAndParseConfigurationFile(path, widgetConfiguration,
-                                         DEFAULT_LANGUAGE, &pErrCode))
+                                         DEFAULT_LANGUAGE))
     {
         LogWarning("Widget archive: Failed while parsing config file");
         ThrowMsg(Exception::ConfigParseFailed, path);
index fe8309c..fdaf1e9 100644 (file)
@@ -33,7 +33,6 @@
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 
-#include <wrt_error.h>
 #include <wrt_common_types.h>
 #include <widget_install/widget_install_popup.h>
 
@@ -120,14 +119,11 @@ class TaskWidgetConfig :
         const std::string& currentPath,
         WrtDB::WidgetRegisterInfo&
         pWidgetConfigInfo,
-        const std::string& baseFolder,
-        int* pErrCode);
+        const std::string& baseFolder);
     bool parseConfigurationFileBrowser(WrtDB::ConfigParserData& configInfo,
-                                       const std::string& _currentPath,
-                                       int* pErrCode);
+                                       const std::string& _currentPath);
     bool parseConfigurationFileWidget(WrtDB::ConfigParserData& configInfo,
-                                      const std::string& _currentPath,
-                                      int* pErrCode);
+                                      const std::string& _currentPath);
     bool fillWidgetConfig(WrtDB::WidgetRegisterInfo& pWidgetConfigInfo,
                           WrtDB::ConfigParserData& configInfo);
 
index 196ce64..79e8407 100644 (file)
@@ -35,13 +35,11 @@ enum Type
 {
     Success,                         ///< Success
 
-    ErrorInvalidWidgetPackage,       ///< ?
-    ErrorWidgetDoesNotExist,         ///< ?
+    ErrorInvalidWidgetPackage,       ///< invalid widget package
+    ErrorWidgetDoesNotExist,         ///< given tizenAppId is invalid, no app
     ErrorAreadyUninstalling,         ///< Widget is already being uninstalled
-    ErrorOutOfDiskSpace,             ///< ?
     ErrorInvalidPackage,             ///< Widget signature is invalid.
-    ErrorAlreadyInstalled,           ///< ?
-    ErrorInternal,                   ///< ?
+    ErrorInternal,                   ///< Internal error due to inconsistency
     ErrorNotAllowed,                 ///< Widget installation or update not
                                      // allowed
                                      ///< because violation of policy ocurred
@@ -62,16 +60,11 @@ DECLARE_JOB_EXCEPTION_BASE(JobExceptionBase, Base, ErrorUnknown)
 // PREPARE
 DECLARE_JOB_EXCEPTION(Base, NotAllowed, ErrorNotAllowed)
 DECLARE_JOB_EXCEPTION(Base, Deferred, ErrorDeferred)
-DECLARE_JOB_EXCEPTION(Base, InvalidWidgetUrl, ErrorInvalidWidgetPackage)
 
 //UNZIP
 DECLARE_JOB_EXCEPTION(Base, OpenZipFailed, ErrorInvalidWidgetPackage)
-DECLARE_JOB_EXCEPTION(Base, GetZipGlobalInfoFailed, ErrorInvalidWidgetPackage)
 DECLARE_JOB_EXCEPTION(Base, ZipEmpty, ErrorInvalidWidgetPackage)
-DECLARE_JOB_EXCEPTION(Base, GetZippedFileInfoFailed, ErrorInvalidWidgetPackage)
-DECLARE_JOB_EXCEPTION(Base, ZippedFileVersionTooNew, ErrorInvalidWidgetPackage)
 DECLARE_JOB_EXCEPTION(Base, ExtractFileFailed, ErrorInvalidWidgetPackage)
-DECLARE_JOB_EXCEPTION(Base, OutOfDiskSpace, ErrorOutOfDiskSpace)
 DECLARE_JOB_EXCEPTION(Base, InternalError, ErrorInternal)
 
 //CERTIFY
@@ -79,9 +72,7 @@ DECLARE_JOB_EXCEPTION(Base, InvalidPackage, ErrorInvalidPackage)
 
 //WCONFIG
 DECLARE_JOB_EXCEPTION(Base, WidgetConfigFileInvalid, ErrorInvalidWidgetPackage)
-DECLARE_JOB_EXCEPTION(Base, NotInstalled, ErrorInvalidWidgetPackage)
 DECLARE_JOB_EXCEPTION(Base, InstallationFailed, ErrorInvalidWidgetPackage)
-DECLARE_JOB_EXCEPTION(Base, AlreadyInstalled, ErrorAlreadyInstalled)
 DECLARE_JOB_EXCEPTION(Base, UnknownError, ErrorUnknown)
 DECLARE_JOB_EXCEPTION(Base, DatabaseFailure, ErrorDatabaseFailure)
 DECLARE_JOB_EXCEPTION(Base, RemovingFolderFailure, ErrorRemovingFolderFailure)
@@ -93,7 +84,6 @@ DECLARE_JOB_EXCEPTION(Base, CopyIconFailed, ErrorUnknown)
 DECLARE_JOB_EXCEPTION(Base, ErrorExternalInstallingFailure, ErrorInstallToExt)
 
 // Installation osp service
-DECLARE_JOB_EXCEPTION(Base, RequestInstallOspsvc, ErrorInstallOspServcie)
 DECLARE_JOB_EXCEPTION(Base, InstallOspsvcFailed, ErrorInstallOspServcie)
 //UPDATE
 DECLARE_JOB_EXCEPTION(Base, BackupFailed, ErrorUpdateWidget)
index 3a15224..275c3fd 100644 (file)
 #include <dpl/log/log.h>
 
 namespace InstallerCallbacksTranslate {
-WrtErrStatus TranslateError(CommonError::Type status)
-{
-    switch (status) {
-    case CommonError::WrtSuccess:
-        return WRT_SUCCESS;
-
-    case CommonError::HandleNotFound:
-        return WRT_ERROR_HANDLE_NOT_FOUND;
-
-    case CommonError::AlreadyRunning:
-        return WRT_ERROR_ALREADY_RUNNING;
-
-    case CommonError::InvalidLanguage:
-        return WRT_ERROR_INVALID_LANGUAGE;
-
-    case CommonError::AlreadyStopped:
-        return WRT_ERROR_ALREADY_STOPPED;
-
-    case CommonError::StillAuthorizing:
-        return WRT_ERROR_STILL_AUTHORIZING;
-
-    case CommonError::EarlyKilled:
-        return WRT_ERROR_EARLY_KILLED;
-
-    case CommonError::AccessDenied:
-        return WRT_ERROR_ACCESS_DENIED;
-
-    default:
-        LogError("Untranslatable error: " << status);
-        return WRT_ERROR_INTERNAL;
-    }
-}
-
-void StatusCallback(std::string tizenId,
-                    CommonError::Type result,
-                    void *data)
-{
-    LogDebug("StatusCallback called  " << tizenId << " | " << result);
-    Assert(data != NULL);
-
-    WrtErrStatus error = TranslateError(result);
-    StatusCallbackStruct* statusCallbackStruct =
-        static_cast<StatusCallbackStruct*>(data);
-
-    if (statusCallbackStruct->status_callback) {
-        statusCallbackStruct->status_callback(tizenId,
-                                              error,
-                                              statusCallbackStruct->userdata);
-    } else {
-        LogInfo("StatusCallback: ignoring NULL callback pointer");
-    }
-
-    delete statusCallbackStruct;
-}
 
 // callback for finished install
 void installFinishedCallback(void *userParam,
@@ -98,10 +44,6 @@ void installFinishedCallback(void *userParam,
             errorStatus = WRT_SUCCESS;
             break;
 
-        case Jobs::WidgetInstall::Exceptions::ErrorInvalidWidgetPackage:
-            errorStatus = WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE;
-            break;
-
         case Jobs::WidgetInstall::Exceptions::ErrorWidgetDoesNotExist:
             errorStatus = WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST;
             break;
@@ -110,18 +52,10 @@ void installFinishedCallback(void *userParam,
             errorStatus = WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING;
             break;
 
-        case Jobs::WidgetInstall::Exceptions::ErrorOutOfDiskSpace:
-            errorStatus = WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE;
-            break;
-
         case Jobs::WidgetInstall::Exceptions::ErrorInvalidPackage:
             errorStatus = WRT_INSTALLER_ERROR_INVALID_CERTIFICATE;
             break;
 
-        case Jobs::WidgetInstall::Exceptions::ErrorAlreadyInstalled:
-            errorStatus = WRT_INSTALLER_ERROR_ALREADY_INSTALLED;
-            break;
-
         case Jobs::WidgetInstall::Exceptions::ErrorInternal:
             errorStatus = WRT_INSTALLER_ERROR_INTERNAL;
             break;
index 9b3eb52..c98e448 100644 (file)
@@ -61,10 +61,6 @@ struct PluginStatusCallbackStruct
     {}
 };
 
-void StatusCallback(std::string tizenId,
-                    CommonError::Type result,
-                    void *data);
-
 void installFinishedCallback(void *userParam,
                              std::string tizenId,
                              Jobs::WidgetInstall::Exceptions::Type status);
index a1c9014..9037cff 100644 (file)
@@ -644,101 +644,65 @@ void WrtInstaller::staticWrtStatusCallback(std::string tizenId,
         }
 
         switch (status) {
-        case WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE:
-            This->m_returnStatus = 1;     //this status is specific
-            fprintf(
-                stderr,
-                "## wrt-installer : %s %s has failed - invalid widget package\n",
-                tizenId.c_str(),
-                printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST:
-            fprintf(
-                stderr,
-                "## wrt-installer : %s %s has failed - widget package does not exist\n",
-                tizenId.c_str(),
-                printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING:
-            fprintf(
-                stderr,
-                "## wrt-installer : %s %s has failed - already uninstalling\n",
-                tizenId.c_str(),
-                printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE:
-            fprintf(stderr,
-                    "## wrt-installer : %s %s has failed - out of disk space\n",
-                    tizenId.c_str(),
-                    printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_INVALID_CERTIFICATE:
-            fprintf(
-                stderr,
-                "## wrt-installer : %s %s has failed - invalid certificate\n",
-                tizenId.c_str(),
-                printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_ALREADY_INSTALLED:
-            fprintf(stderr,
-                    "## wrt-installer : %s %s has failed - already installed\n",
-                    tizenId.c_str(),
-                    printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_INTERNAL:
-            fprintf(stderr,
-                    "## wrt-installer : %s %s has failed - internal error\n",
-                    tizenId.c_str(),
-                    printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_NOT_ALLOWED:
-            fprintf(
-                stderr,
-                "## wrt-installer : %s %s has failed - installation or update not allowed; invalid"
-                " mode\n",
-                tizenId.c_str(),
-                printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_DEFERRED:
-            fprintf(
-                stderr,
-                "## wrt-installer : deferred: widget update will continue after the widget"
-                " has been stopped\n");
-            break;
-
-        case WRT_INSTALLER_ERROR_DATABASE_FAILURE:
-            fprintf(stderr,
-                    "## wrt-installer : %s %s has failed - database failure\n",
-                    tizenId.c_str(),
-                    printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_OSPSVC:
-            fprintf(
-                stderr,
-                "## wrt-installer : %s %s has failed - during installation or"
-                " uninstallation osp service\n",
-                tizenId.c_str(),
-                printMsg.c_str());
-            break;
-
-        case WRT_INSTALLER_ERROR_UNKNOWN:
-            fprintf(stderr,
-                    "## wrt-installer : %s %s has failed - unknown error\n",
-                    tizenId.c_str(),
-                    printMsg.c_str());
-            break;
-
-        default:
-            break;
+            case WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE:
+                This->m_returnStatus = 1; //this status is specific
+                fprintf(stderr, "## wrt-installer : %s %s has failed - invalid widget package\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST:
+                fprintf(stderr, "## wrt-installer : %s %s has failed - widget package does not exist\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING:
+                fprintf(stderr, "## wrt-installer : %s %s has failed - already uninstalling\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_INVALID_CERTIFICATE:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - invalid certificate\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_ALREADY_INSTALLED:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - already installed\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_INTERNAL:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - internal error\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_NOT_ALLOWED:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - installation or update not allowed; invalid"
+                       " mode\n", tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_DEFERRED:
+                fprintf(stderr,"## wrt-installer : deferred: widget update will continue after the widget"
+                       " has been stopped\n");
+                break;
+
+            case WRT_INSTALLER_ERROR_DATABASE_FAILURE:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - database failure\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_OSPSVC:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - during installation or"
+                        " uninstallation osp service\n", tizenId.c_str(),
+                        printMsg.c_str());
+                break;
+
+            case WRT_INSTALLER_ERROR_UNKNOWN:
+                fprintf(stderr,"## wrt-installer : %s %s has failed - unknown error\n",
+                        tizenId.c_str(), printMsg.c_str());
+                break;
+
+            default:
+                break;
         }
     } else {
         fprintf(stderr,
index 2163cfe..f061805 100644 (file)
@@ -42,47 +42,25 @@ typedef enum
 {
     /* Generic success */
     WRT_SUCCESS = 0,                /*< Success*/
-    WRT_ALREADY_INIT,               /*< Wrt already initialized*/
-    WRT_UPDATE_NEED,                /*< Widget data has been updated*/
-    WRT_SHUTDOWN,                   /*<WRT daemon has been closed*/
-
-    /* Version result */
-    WRT_VERSION_OLD = 128,          /*< widget's version is older*/
-    WRT_VERSION_NEW,                /*< widget's version is latest*/
-    WRT_VERSION_EXACT,              /*< widget's version the same as in arg*/
-    WRT_VERSION_NOT_COMPARABLE,     /*< widget's version are not comparable */
 
     /* Error result */
     WRT_ERROR_INTERNAL = -128,      /*< Internal library error.
                                      * Should never occur */
-    WRT_ERROR_INVALID_PARAMETER,    /*< Invalid parameter value was given
-                                     * (eg. NULL) */
-    WRT_ERROR_HANDLE_NOT_FOUND,     /*< Widget handle was not found */
-    WRT_ERROR_ID_NOT_FOUND,         /*< Widget id was not found */
+
     WRT_ERROR_PKGNAME_NOT_FOUND,    /*< package name was not found */
-    WRT_ERROR_ALREADY_RUNNING,      /*< Widget is already running */
-    WRT_ERROR_ALREADY_STOPPED,      /*< Widget is already stopped */
-    WRT_ERROR_STILL_AUTHORIZING,    /*< Widget is still autorizing and has not
-                                     * yet finished it */
-    WRT_ERROR_EARLY_KILLED,         /*< Widget was early killed during launch */
-    WRT_ERROR_ACCESS_DENIED,        /*< Access denied from ACE */
-    WRT_ERROR_NOT_INITIALIZED,      /*<Occur if wrt initialization fails*/
-    WRT_ERROR_INIT,                 /*<Occur if wrt initialization fails*/
-    WRT_ERROR_CONNECTION,           /*<Connectiond error occured*/
     WRT_ERROR_NO_PATH,              /*<One of specific directory does not
                                      * exist*/
 
     /* Installer Errors*/
-    WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE, /*<  */
-    WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST,  /*<  */
+    WRT_INSTALLER_ERROR_INVALID_WIDGET_PACKAGE, /*< package is malformed */
+    WRT_INSTALLER_ERROR_WIDGET_DOES_NOT_EXIST,  /*< given tizenAppId is invalid */
 
     WRT_INSTALLER_ERROR_ALREADY_UNINSTALLING,   /*< Widget is already being
                                                  * uninstalled */
-    WRT_INSTALLER_ERROR_OUT_OUT_DISK_SPACE,     /*<  */
     WRT_INSTALLER_ERROR_INVALID_CERTIFICATE,    /*<  */
     WRT_INSTALLER_ERROR_ALREADY_INSTALLED,      /*< Widget is already installed
                                                  */
-    WRT_INSTALLER_ERROR_INTERNAL,               /*<  */
+    WRT_INSTALLER_ERROR_INTERNAL,               /*< Internal error due to inconsistency */
     WRT_INSTALLER_ERROR_NOT_ALLOWED,            /*< Widget installation or
                                                  * update not allowed */
                                                 /*< because violation of policy
@@ -92,10 +70,8 @@ typedef enum
     WRT_INSTALLER_ERROR_DATABASE_FAILURE,       /*< Failure in database */
     WRT_INSTALLER_ERROR_UNKNOWN,                /*< Temporary error. Try to not
                                                  * use this. */
-    WRT_INSTALLER_ERROR_OSPSVC,                 /*< */
-    WRT_ERROR_INVALID_LANGUAGE,                 /*< Widget is not valid in
-                                                 *  current locales*/
-
+    WRT_INSTALLER_ERROR_OSPSVC,                 /*< Error of installation
+                                                 * of osp service */
     /* Plugin Installer Errors */
     WRT_PLUGIN_INSTALLER_ERROR_WRONG_PATH,       /*< Wrong Path to plugin Dir */
     WRT_PLUGIN_INSTALLER_ERROR_METAFILE,         /*< Plugin metafile error */
@@ -108,145 +84,6 @@ typedef enum
     WRT_PLUGIN_INSTALLER_ERROR_UNKNOWN           /*< Unknown error*/
 } WrtErrStatus;
 
-typedef struct
-{
-    char* id;           /**< the widget's id
-                         * (read from its config.xml during installation)*/
-    char* name;         /**< the widget's name
-                         * (read from its config.xml during installation)*/
-    char* version;      /**< the widget's varsion
-                         * (read from its config.xml during installation)*/
-    char* icon_path;    /**< the widget's icon_path
-                         * (read from its config.xml during installation)*/
-    char* pkg_name;     /**< the widget's pkg name */
-
-    /**< the widget's application storage size */
-    size_t application_size;
-    /**< the widget's data storage size */
-    size_t data_size;
-} wrt_widget_info;
-
-typedef struct
-{
-    char *src; /**< valid path to widget's icon*/
-    int width;  /**< the width of the icon in pixels*/
-    int height;  /**< the height of the icon in pixels*/
-} wrt_widget_icon;
-
-typedef struct
-{
-    int width;      /**< the width of the widget in pixels*/
-    int height;     /**< the height of the widget in pixels*/
-} wrt_widget_size;
-
-typedef struct
-{
-    char *widget_name;              /**< the widget's name*/
-    wrt_widget_icon *widget_icon;   /**< the widget's icon data*/
-    wrt_widget_size widget_size;    /**< the widget's size data*/
-    wrt_widget_info *widget_info;   /**< the widget's info data*/
-} wrt_widget_info_data;
-
-/**
- * @fn inline bool wrt_has_succeded(WrtErrStatus err)
- * @brief Checks whether call succeded
- *
- * This function checks whether call succeded.
- * If call succeded it returns TRUE.
- *
- * @param [in] err WrtErrStatus to check
- *
- * @return Result of the test
- * @retval TRUE     - the call was successful
- * @retval FALSE    - the call failed
- *
- * Sample code:
- * @code
- *      static void InitCallback(WrtErrStatus status, void *data)
- *      {
- *          MyApplication *This = (MyApplication *)(data);
- *
- *          printf("[LAUNCH-WIDGET] init callback");
- *
- *          if (wrt_has_succeded(status) && status!=WRT_UPDATE_NEED)
- *          {
- *             This->InstallAllPlugins();
- *
- *             if (This->m_argc == 2)
- *                 wrt_install_widget(This->m_argv[1], This, InstallCallback);
- *          }
- *          else if(wrt_has_failed(status))
- *              printf("[LAUNCH-WIDGET] INITIALIZATION HAS FAILED");
- *      }
- * @endcode
- *
- * @see wrt_has_failed
- */
-inline bool wrt_has_succeded(WrtErrStatus err)
-{
-    return (err >= 0);
-}
-
-/**
- * @fn inline bool wrt_has_failed(WrtErrStatus err)
- * @brief Checks whether call failed
- *
- * This function checks whether call failed.
- * If call failed it returns TRUE.
- *
- * @param [in] err WrtErrStatus to check
- *
- * @return Result of the test
- * @retval TRUE     - the call failed
- * @retval FALSE    - the call was successful
- *
- * Sample code:
- * @code
- *      static void InitCallback(WrtErrStatus status, void *data)
- *      {
- *          MyApplication *This = (MyApplication *)(data);
- *
- *          printf("[LAUNCH-WIDGET] init callback");
- *
- *          if (wrt_has_succeded(status) && status!=WRT_UPDATE_NEED)
- *          {
- *             This->InstallAllPlugins();
- *
- *             if (This->m_argc == 2)
- *                 wrt_install_widget(This->m_argv[1], This, InstallCallback);
- *          }
- *          else if(wrt_has_failed(status))
- *              printf("[LAUNCH-WIDGET] INITIALIZATION HAS FAILED");
- *      }
- * @endcode
- *
- * @see wrt_has_succeded
- */
-inline bool wrt_has_failed(WrtErrStatus err)
-{
-    return (err < 0);
-}
-
-namespace CommonError {
-enum Type
-{
-    WrtSuccess,                ///< Success
-
-    HandleNotFound,         ///< Widget handle was not found
-    AlreadyRunning,         ///< Widget is already running
-    AlreadyStopped,         ///< Widget is already stopped
-    InvalidLanguage,        ///< Widget is invalid in current locales
-    StillAuthorizing,       ///< Widget is still autorizing and has not yet
-                            // finished it
-    EarlyKilled,            ///< Widget was early killed during launch
-    AccessDenied,           ///< Access denied from ACE
-    CertificateRevoked,     ///< Some certificate was revoked.
-                            ///  Widget is not allowed to run.
-
-    Unknown                 ///< Temporary error. Try to not use this.
-};
-}
-
 #ifdef __cplusplus
 }
 #endif