From 86fcfed585b97fc629177fc1fb64c45e718f716d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 24 Nov 2015 11:33:05 +0100 Subject: Use strerror for more detailed error messages. --- source/fitz/stream-open.c | 4 ++-- 1 file 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 -- cgit v1.2.3