From: Marcin Kaminski Date: Fri, 14 Dec 2012 13:41:25 +0000 (+0100) Subject: [NABI][TWEB-678] Fix for unhandled exception X-Git-Tag: accepted/tizen_2.1/20130425.023916~20^2~24^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f71331a8c91a31f4cb7efe17b235b71ab7aae26b;p=framework%2Fweb%2Fwrt-installer.git [NABI][TWEB-678] Fix for unhandled exception [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 --- diff --git a/src/jobs/widget_install/job_widget_install.cpp b/src/jobs/widget_install/job_widget_install.cpp index 70ce1c0..2006f9c 100644 --- a/src/jobs/widget_install/job_widget_install.cpp +++ b/src/jobs/widget_install/job_widget_install.cpp @@ -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 { diff --git a/src/jobs/widget_install/task_unzip.cpp b/src/jobs/widget_install/task_unzip.cpp index b19bc19..fb084f6 100644 --- a/src/jobs/widget_install/task_unzip.cpp +++ b/src/jobs/widget_install/task_unzip.cpp @@ -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()