From e479598b2e31d4963a3501e2f383af82dada296f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 7 Sep 2015 20:46:10 +0100 Subject: Provide slightly more description error on file open failure --- lib/docx/files.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/docx/files.js b/lib/docx/files.js index 0e95197..6380ea4 100644 --- a/lib/docx/files.js +++ b/lib/docx/files.js @@ -14,7 +14,10 @@ exports.uriToPath = uriToPath; function Files(base) { function read(uri, encoding) { return resolveUri(uri).then(function(path) { - return readFile(path, encoding); + return readFile(path, encoding).caught(function(error) { + var message = "could not open external image: '" + uri + "' (document directory: '" + base + "')\n" + error.message; + return promises.reject(new Error(message)); + }); }); } -- cgit v1.2.3