[Issue#] N/A
[Bug] remove function is called without checking result.
[Cause] N/A
[Solution] check addded
[Verification] Verification steps
1. Install widget
2. Manipulate database to add non-existing locations.
3. During updating(or -if installation) or uninstalling this files should be listed as external files to be removed but not existing(warning in logs)
Change-Id: I6f4652e19b36354e39d3e339897d3cc374ce6641
if(WrtUtilFileExists(*file))
{
LogDebug(" -> " << *file);
- remove(file->c_str());
+ if (-1 == TEMP_FAILURE_RETRY(remove(file->c_str()))) {
+ ThrowMsg(Exceptions::RemovingFileFailure,
+ "Failed to remove external file");
+ }
}
else if(WrtUtilDirExists(*file))
{
DECLARE_JOB_EXCEPTION(Base, UnknownError, ErrorUnknown)
DECLARE_JOB_EXCEPTION(Base, DatabaseFailure, ErrorDatabaseFailure)
DECLARE_JOB_EXCEPTION(Base, RemovingFolderFailure, ErrorRemovingFolderFailure)
+DECLARE_JOB_EXCEPTION(Base, RemovingFileFailure, ErrorRemovingFolderFailure)
DECLARE_JOB_EXCEPTION(Base, CreateVconfFailure, ErrorCreateVconfFailure)
DECLARE_JOB_EXCEPTION(Base, CopyIconFailed, ErrorUnknown)