Translators that specify an error handler for a child translator shouldn't throw on error

This commit is contained in:
Simon Kornblith 2012-02-09 14:01:31 -05:00
parent f74df0f7fd
commit 1feb5c5fc2

View file

@ -219,7 +219,9 @@ Zotero.Translate.Sandbox = {
return translation.setSearch(arg);
};
safeTranslator.setDocument = function(arg) { return translation.setDocument(arg) };
var errorHandlerSet = false;
safeTranslator.setHandler = function(arg1, arg2) {
if(arg1 === "error") errorHandlerSet = true;
translation.setHandler(arg1,
function(obj, item) {
try {
@ -288,7 +290,7 @@ Zotero.Translate.Sandbox = {
return translation.getTranslators();
};
var errorHandlerSet = false, doneHandlerSet = false;
var doneHandlerSet = false;
safeTranslator.translate = function() {
translate.incrementAsyncProcesses("safeTranslator#translate()");
setDefaultHandlers(translate, translation);