Selaa lähdekoodia

Merge pull request #3564 from ghalliday/issue8000

HPCC-8000 Improve error message when cannot open a file.

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 vuotta sitten
vanhempi
commit
8ec53c3e1e
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      ecl/hql/hqlexpr.cpp

+ 3 - 0
ecl/hql/hqlexpr.cpp

@@ -7161,6 +7161,9 @@ void CFileContents::ensureLoaded()
         throw MakeStringException(1, "File %s could not be opened", file->queryFilename());
 
     offset_t size = io->size();
+    if (size == (offset_t)-1)
+        throw MakeStringException(1, "File %s could not be read", file->queryFilename());
+
     size32_t sizeToRead = (size32_t)size;
     if (sizeToRead != size)
         throw MakeStringException(1, "File %s is larger than 4Gb", file->queryFilename());