aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-09-07 20:46:10 +0100
committerMichael Williamson <mike@zwobble.org>2015-09-07 20:46:10 +0100
commite479598b2e31d4963a3501e2f383af82dada296f (patch)
tree57205c2d7dfeaedea6392ad996d399fd82d7a5c3 /lib
parent2596c1c7122096874d00d7c5392d4ffb482e31b6 (diff)
Provide slightly more description error on file open failure
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/files.js5
1 files changed, 4 insertions, 1 deletions
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));
+ });
});
}