From b13b46c641fe69de3ff7563d886b293dbdc31c65 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 20 Aug 2013 16:55:01 -0400 Subject: [PATCH] Use consistent style for promises --- chrome/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 index 91dea3888..4c7564b43 100644 --- 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; }); }