Propagate errors in child translators to parents
See http://groups.google.com/group/zotero-dev/browse_thread/thread/59dbd15bf6c84133
This commit is contained in:
parent
79b1fe30dc
commit
b617c508b1
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue