Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-05 03:26:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-05 03:26:55 +0400
commita824220d3e71afda0460c769324c9029243d0560 (patch)
tree6b9fc10147a117db415d6dbb47d1a9203616f78a /source/blender/readblenfile
parent66a72343ef7bda52a30c0e96b17e792016d924b3 (diff)
better errors for failier to read blends
Diffstat (limited to 'source/blender/readblenfile')
-rw-r--r--source/blender/readblenfile/intern/BLO_readblenfile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/readblenfile/intern/BLO_readblenfile.c b/source/blender/readblenfile/intern/BLO_readblenfile.c
index 608c8fccd18..7c876c96a86 100644
--- a/source/blender/readblenfile/intern/BLO_readblenfile.c
+++ b/source/blender/readblenfile/intern/BLO_readblenfile.c
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
+#include <errno.h>
#ifdef WIN32
#include <io.h> // read, open
@@ -136,7 +137,7 @@ blo_read_runtime(
fd= open(path, O_BINARY|O_RDONLY, 0);
if (fd==-1) {
- BKE_report(reports, RPT_ERROR, "Unable to open");
+ BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", path, strerror(errno));
goto cleanup;
}
@@ -146,13 +147,13 @@ blo_read_runtime(
datastart= handle_read_msb_int(fd);
if (datastart==-1) {
- BKE_report(reports, RPT_ERROR, "Unable to read");
+ BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (problem seeking)", path);
goto cleanup;
} else if (read(fd, buf, 8)!=8) {
- BKE_report(reports, RPT_ERROR, "Unable to read");
+ BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (truncated header)", path);
goto cleanup;
} else if (memcmp(buf, "BRUNTIME", 8)!=0) {
- BKE_report(reports, RPT_ERROR, "File is not a Blender file");
+ BKE_reportf(reports, RPT_ERROR, "Unable to read \"%s\" (not a blend file)", path);
goto cleanup;
} else {
//printf("starting to read runtime from %s at datastart %d\n", path, datastart);