harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp
changeset 1 acef663c1218
parent 0 c53acadfccc6
child 3 6752808b2036
--- a/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp	Mon Jan 18 20:34:07 2010 +0200
+++ b/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp	Tue Jan 26 12:13:20 2010 +0200
@@ -266,12 +266,14 @@
     CHarvestData* harvestData = CHarvestData::NewL();
     CleanupStack::PushL( harvestData );
         
-    const TInt errorCode = GatherDataL( mdeObject, *fileData, *harvestData );
-    if ( errorCode == KErrNone || errorCode == KErrCompletion ) // ok, something got harvested
+    TInt errorCode( KErrNone );
+    TRAPD( error, errorCode = GatherDataL( mdeObject, *fileData, *harvestData ) );
+    if ( error == KErrNone && (errorCode == KErrNone || errorCode == KErrCompletion ) ) // ok, something got harvested
         {
         if ( mdeObject.Id() == 0 || mdeObject.Placeholder() ) // is a new object or placeholder
             {
             TRAP_IGNORE( HandleObjectPropertiesL( *harvestData, *fileData, *aHD, ETrue ) );
+            mdeObject.SetPlaceholder( EFalse );
             }
         else   // not a new object
             {
@@ -305,6 +307,14 @@
         	aHD->SetLocationData( locData );
         	}
         }
+    else if( error != KErrNone)
+        {
+        WRITELOG1( "CHarvesterImagePlugin::HarvestL() - other error: %d", error );
+        TInt convertedError = KErrNone;
+        MdsUtils::ConvertTrapError( error, convertedError );
+        aHD->SetErrorCode( convertedError );
+        WRITELOG1( "CHarvesterImagePlugin::HarvestL() - returning: %d", convertedError );
+        }
     else
         {
         WRITELOG1( "CHarvesterImagePlugin::HarvestL() - other error: %d", errorCode );