changeset 32:8d2b29fd4de5

cont
author Alain Mazy
date Fri, 09 Oct 2020 10:16:50 +0200
parents 67a7102d8d0f
children 70da4ce5c7cc
files Aws/AwsS3StoragePlugin.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Aws/AwsS3StoragePlugin.cpp	Fri Oct 09 10:15:21 2020 +0200
+++ b/Aws/AwsS3StoragePlugin.cpp	Fri Oct 09 10:16:50 2020 +0200
@@ -130,14 +130,17 @@
       {
         return objectList[0].GetSize();
       }
-      throw StoragePluginException(std::string("error while reading file ") + path_ + ": multiple objet with same name !");
+      else if (objectList.size() > 1)
+      {
+        throw StoragePluginException(std::string("error while reading file ") + path_ + ": multiple objet with same name !");
+      }
+      throw StoragePluginException(std::string("error while reading file ") + path_ + ": object not found !");
     }
     else
     {
       throw StoragePluginException(std::string("error while reading file ") + path_ + ": " + result.GetError().GetExceptionName().c_str() + " " + result.GetError().GetMessage().c_str());
     }
   }
-
   virtual void Read(char* data, size_t size)
   {
     Aws::S3::Model::GetObjectRequest getObjectRequest;