Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/115364
Change subject: Fix the usage of promise for page loader ...................................................................... Fix the usage of promise for page loader As per https://github.com/kriskowal/q/wiki/Coming-from-jQuery Change-Id: I5037141bdedf0dc6aa7fdf9782608b4162cb6c60 --- M server/models/dataModelManager.js 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/64/115364/1 diff --git a/server/models/dataModelManager.js b/server/models/dataModelManager.js index 501af26..b79668b 100644 --- a/server/models/dataModelManager.js +++ b/server/models/dataModelManager.js @@ -38,7 +38,7 @@ } else { PageLoader = require( __dirname + '/../pageloader/PageLoader.js').PageLoader; pageloader = new PageLoader( dataModelManager.context.sourcePage ); - pageloader.load().done( function ( data ) { + pageloader.load().then( function ( data ) { dataModelManager.context.sourceText = data; segmenter = new CXSegmenter( dataModelManager.context.sourceText ); segmenter.segment(); @@ -54,6 +54,9 @@ dataModelManager.publish(); // TODO: Dispatch the context to a number of task runners // Once each task runners finish, publish. + }, function ( /*jqXHR, textStatus, errorThrown*/ ) { + console.error( '[CX] Error in retrieving the page ' + + dataModelManager.context.sourcePage ); } ); } } ); -- To view, visit https://gerrit.wikimedia.org/r/115364 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5037141bdedf0dc6aa7fdf9782608b4162cb6c60 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits