www

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

commit b617c508b144128ee4fa446260dbae0966ed2bd3
parent 79b1fe30dcb36b810fae27bbae4e1197688bae52
Author: Simon Kornblith <simon@simonster.com>
Date:   Fri, 20 Jan 2012 16:16:15 -0500

Propagate errors in child translators to parents

See http://groups.google.com/group/zotero-dev/browse_thread/thread/59dbd15bf6c84133

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -288,7 +288,7 @@ Zotero.Translate.Sandbox = { return translation.getTranslators(); }; - var doneHandlerSet = false; + var errorHandlerSet = false, doneHandlerSet = false; safeTranslator.translate = function() { translate.incrementAsyncProcesses("safeTranslator#translate()"); setDefaultHandlers(translate, translation); @@ -296,6 +296,10 @@ Zotero.Translate.Sandbox = { doneHandlerSet = true; translation.setHandler("done", function() { translate.decrementAsyncProcesses("safeTranslator#translate()") }); } + if(!errorHandlerSet) { + errorHandlerSet = true; + translation.setHandler("error", function(obj, error) { translate.complete(false, error) }); + } return translation.translate(false); };