[NABI][TWEB-678] Fix for unhandled exception
authorMarcin Kaminski <marcin.ka@samsung.com>
Fri, 14 Dec 2012 13:41:25 +0000 (14:41 +0100)
committerMarcin Kaminski <marcin.ka@samsung.com>
Fri, 14 Dec 2012 13:41:25 +0000 (14:41 +0100)
[Issue#] TWEB-678 (NABI)
[Bug] Unhandled exception while installing
broken package
[Cause] Lack of Exception catching
[Solution] Proper catch and throw added

[Verication] Build package. Try to install
z4.html file from:
https://tizendev.org/bugs/browse/TWEB-678
(it is widget package - not .html page)

Change-Id: I0dceed2db098bf6bbbd9af554ca79e6343f78b6f

src/jobs/widget_install/job_widget_install.cpp
src/jobs/widget_install/task_unzip.cpp

index 70ce1c0..2006f9c 100644 (file)
@@ -617,6 +617,11 @@ ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
         LogError("Failed to parse config.xml file");
         return ConfigParserData();
     }
+    Catch(DPL::ZipInput::Exception::SeekFileFailed)
+    {
+        LogError("Failed to seek widget archive - corrupted package?");
+        return ConfigParserData();
+    }
     return configInfo;
 }
 
@@ -840,6 +845,11 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType(
             LogDebug("Failed to open widget package");
             return PKG_TYPE_UNKNOWN;
         }
+        Catch(DPL::ZipInput::Exception::SeekFileFailed)
+        {
+            LogError("Failed to seek widget package file");
+            return PKG_TYPE_UNKNOWN;
+        }
 
         Try
         {
index b19bc19..fb084f6 100644 (file)
@@ -116,6 +116,10 @@ void TaskUnzip::StepUnzipPrepare()
     {
         ReThrowMsg(Exceptions::OpenZipFailed, m_installerContext.locations->getWidgetSource());
     }
+    Catch(DPL::ZipInput::Exception::SeekFileFailed)
+    {
+        ThrowMsg(Exceptions::ExtractFileFailed,"m_installerContext.locations->getWidgetSource()");
+    }
 }
 
 void TaskUnzip::StepUnzipProgress()