if (m_context.existingWidgetInfo.isExist) //update
{
- m_handleToRemove = WidgetDAOReadOnly::getHandle(
- m_context.locations->getPkgname());
LogInfo("Registering widget... (update)");
+ Try
+ {
+ m_handleToRemove = WidgetDAOReadOnly::getHandle(
+ m_context.locations->getPkgname());
+ }
+ Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
+ {
+ LogError("Given tizenId not found for update installation (Same GUID?)");
+ ThrowMsg(Exceptions::InvalidPackage, "Given tizenId not found for update installation");
+ }
WidgetDAO::registerOrUpdateWidget(
m_context.locations->getPkgname(),
m_context.widgetConfig,
m_context.wacSecurity.getCertificateList()))
{
LogError("ace database insert failed");
- ThrowMsg(Exceptions::NotAllowed, "Update failure. ace_register_widget failed");
+ ThrowMsg(Exceptions::UpdateFailed, "Update failure. ace_register_widget failed");
}
LogDebug("Ace data inserted");
WrtDB::ExternalLocationList externalLocationsUpdate = m_context.locations->listExternalLocations();
if (m_context.existingWidgetInfo.isExist) //update
{
- WidgetDAO dao(m_context.locations->getPkgname());
- WrtDB::ExternalLocationList externalLocationsDB = dao.getWidgetExternalLocations();
- FOREACH(file, externalLocationsDB)
+ Try
{
- if(std::find(externalLocationsUpdate.begin(), externalLocationsUpdate.end(), *file) == externalLocationsUpdate.end())
+ WidgetDAO dao(m_context.locations->getPkgname());
+ WrtDB::ExternalLocationList externalLocationsDB = dao.getWidgetExternalLocations();
+ FOREACH(file, externalLocationsDB)
{
- m_externalLocationsToRemove.push_back(*file);
+ if(std::find(externalLocationsUpdate.begin(), externalLocationsUpdate.end(), *file) == externalLocationsUpdate.end())
+ {
+ m_externalLocationsToRemove.push_back(*file);
+ }
}
}
+ Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
+ {
+ LogError("Given tizenId not found for update installation (Same GUID?)");
+ ThrowMsg(Exceptions::UpdateFailed, "Given tizenId not found for update installation");
+ }
}
LogDebug("Registering external files:");
FOREACH(file, externalLocationsUpdate)
DECLARE_JOB_EXCEPTION(Base, InsertNewWidgetFailed, ErrorUpdateWidget)
DECLARE_JOB_EXCEPTION(Base, RemoveBackupFailed, ErrorUpdateWidget)
+//Database
+DECLARE_JOB_EXCEPTION(Base, UpdateFailed, ErrorInvalidWidgetPackage)
+
// Plugins copy errors
DECLARE_JOB_EXCEPTION(Base, EmptyPluginsDirectory, ErrorInvalidWidgetPackage)
DECLARE_JOB_EXCEPTION(Base, PluginsSubdirectory, ErrorInvalidWidgetPackage)