浏览代码

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 年之前
父节点
当前提交
8ec53c3e1e
共有 1 个文件被更改,包括 3 次插入0 次删除
  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());
         throw MakeStringException(1, "File %s could not be opened", file->queryFilename());
 
 
     offset_t size = io->size();
     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;
     size32_t sizeToRead = (size32_t)size;
     if (sizeToRead != size)
     if (sizeToRead != size)
         throw MakeStringException(1, "File %s is larger than 4Gb", file->queryFilename());
         throw MakeStringException(1, "File %s is larger than 4Gb", file->queryFilename());