summaryrefslogtreecommitdiff
path: root/source/fitz/stream-open.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-11-24 11:33:05 +0100
committerTor Andersson <tor.andersson@artifex.com>2015-12-11 11:47:26 +0100
commit86fcfed585b97fc629177fc1fb64c45e718f716d (patch)
tree12d37b854ec6202f0b6e1e72df5684fffacd19ec /source/fitz/stream-open.c
parent6b0f4f79cdac06fe790830331bb2b41d8a9a204b (diff)
downloadmupdf-86fcfed585b97fc629177fc1fb64c45e718f716d.tar.xz
Use strerror for more detailed error messages.
Diffstat (limited to 'source/fitz/stream-open.c')
-rw-r--r--source/fitz/stream-open.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/fitz/stream-open.c b/source/fitz/stream-open.c
index 4a3b69ad..b4df2a61 100644
--- a/source/fitz/stream-open.c
+++ b/source/fitz/stream-open.c
@@ -142,7 +142,7 @@ fz_open_file(fz_context *ctx, const char *name)
f = fz_fopen(name, "rb");
#endif
if (f == NULL)
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open %s", name);
+ fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open %s: %s", name, strerror(errno));
return fz_open_file_ptr(ctx, f);
}
@@ -152,7 +152,7 @@ fz_open_file_w(fz_context *ctx, const wchar_t *name)
{
FILE *f = _wfopen(name, L"rb");
if (f == NULL)
- fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open file %ls", name);
+ fz_throw(ctx, FZ_ERROR_GENERIC, "cannot open file %ls: %s", name, strerror(errno));
return fz_open_file_ptr(ctx, f);
}
#endif