diff options
| author | hallgren <hallgren@chalmers.se> | 2014-04-06 23:13:18 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2014-04-06 23:13:18 +0000 |
| commit | ea67953012f1b8cff1cefc24f91637e29c9b9e87 (patch) | |
| tree | c2e844f1c36ed2f7cb1820903b40bf533d18b486 | |
| parent | 5344d42536463fa35194cf02a5a903ca76d90701 (diff) | |
Wide coverage demo app: show an error message if linearization fails
| -rw-r--r-- | src/www/js/wc.js | 7 |
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") } |
