www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit b13b46c641fe69de3ff7563d886b293dbdc31c65
parent 93411a3daca2c2247838dabdfbc66afe825a45c4
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 20 Aug 2013 16:55:01 -0400

Use consistent style for promises

Diffstat:
Mchrome/content/zotero/xpcom/translation/translators.js | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translators.js b/chrome/content/zotero/xpcom/translation/translators.js @@ -152,9 +152,11 @@ Zotero.Translators = new function() { */ this.loadFromDisk = function(file) { const infoRe = /^\s*{[\S\s]*?}\s*?[\r\n]/; - return Zotero.File.getContentsAsync(file).then(function(source) { + return Zotero.File.getContentsAsync(file) + .then(function(source) { return Zotero.Translators.load(file, infoRe.exec(source)[0], source); - }).fail(function() { + }) + .fail(function() { throw "Invalid or missing translator metadata JSON object in " + file.leafName; }); }