From ceb6de156150d7a82905266fdd77882b93ed7231 Mon Sep 17 00:00:00 2001 From: hallgren Date: Sun, 6 Apr 2014 23:13:18 +0000 Subject: [PATCH] Wide coverage demo app: show an error message if linearization fails --- src/www/js/wc.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/www/js/wc.js b/src/www/js/wc.js index a894ccaad..85cd1a645 100644 --- a/src/www/js/wc.js +++ b/src/www/js/wc.js @@ -93,14 +93,15 @@ wc.translate=function() { function step3(tra) { if(wc.serial==current) { if(tra.length>=1) { - if(tra[0].error) show_error(tra[0].error) - else { - var r=tra[0] + var r=tra[0] + if(r.error) show_error(tra[0].error) + else if(r.linearizations) { r.text=r.linearizations[0].text // Two server requests in parallel: unlextext(r.text,function(text){showit(r,text)}) if(wc.p && i<9) trans(text,i+1) } + else show_error("no linearizations") } else if(i==0) show_error("Unable to translate") }