Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393519 )

Change subject: Youdao: Fix the error code reading
......................................................................

Youdao: Fix the error code reading

First check if response.body.errorCode is present. If not go for
response.body. This was reverse in I9738d71971753f4

Change-Id: Id8ff3ff26f92a30c1eb7baa8ea471067f415e223
---
M lib/mt/Youdao.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/19/393519/1

diff --git a/lib/mt/Youdao.js b/lib/mt/Youdao.js
index 8f16a82..5ec5cc1 100644
--- a/lib/mt/Youdao.js
+++ b/lib/mt/Youdao.js
@@ -103,7 +103,7 @@
                                return response.body.translation[ 0 ];
                        } else {
                                throw new Error( 'Translation with Youdao 
failed. Error: ' +
-                                       this.getErrorName( response.body || 
response.body.errorCode ) +
+                                       this.getErrorName( 
response.body.errorCode || response.body ) +
                                                ` for ${sourceLang} > 
${targetLang}` );
                        }
                } );

-- 
To view, visit https://gerrit.wikimedia.org/r/393519
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8ff3ff26f92a30c1eb7baa8ea471067f415e223
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
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

Reply via email to