summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-04-06 23:13:18 +0000
committerhallgren <hallgren@chalmers.se>2014-04-06 23:13:18 +0000
commitea67953012f1b8cff1cefc24f91637e29c9b9e87 (patch)
treec2e844f1c36ed2f7cb1820903b40bf533d18b486
parent5344d42536463fa35194cf02a5a903ca76d90701 (diff)
Wide coverage demo app: show an error message if linearization fails
-rw-r--r--src/www/js/wc.js7
1 files 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")
}