diff --git a/src/replace.js b/src/replace.js index 7286fd6..30778a3 100644 --- a/src/replace.js +++ b/src/replace.js @@ -75,6 +75,9 @@ EPUBJS.replace.links = function(_store, full, done, link){ setTimeout(function(){ done(url, full); }, 5); //-- Allow for css to apply before displaying chapter + }, function(reason) { + // we were unable to replace the style sheets + done(null); }); }else{ _store.getUrl(full).then(done, function(reason) { @@ -100,10 +103,12 @@ EPUBJS.replace.stylesheets = function(_store, full) { deferred.resolve(url); - }, function(e) { - console.error(e); + }, function(reason) { + deferred.reject(reason); }); + }, function(reason) { + deferred.reject(reason); }); return deferred.promise; diff --git a/src/unarchiver.js b/src/unarchiver.js index 4944f55..78824b1 100644 --- a/src/unarchiver.js +++ b/src/unarchiver.js @@ -68,7 +68,10 @@ EPUBJS.Unarchiver.prototype.getText = function(url, encoding){ var _URL = window.URL || window.webkitURL || window.mozURL; if(!entry) { - console.warn("File not found in the contained epub:", url); + deferred.reject({ + message : "File not found in the epub: " + url, + stack : new Error().stack + }); return deferred.promise; }