提交 57af7b51 编写于 作者: a865501259's avatar a865501259

error log: add no equal

上级 bdd1d147
...@@ -65,7 +65,7 @@ async function translateValue(value, api) { ...@@ -65,7 +65,7 @@ async function translateValue(value, api) {
return result.result return result.result
} }
if (value.length > result.result.length) { if (api == "youdao" && value.length > result.result.length) {
return translateValue(value.slice(result.result.length), api).then(youdao => { return translateValue(value.slice(result.result.length), api).then(youdao => {
// tjs translate youdao BUG and tjs baidu will return undefined // tjs translate youdao BUG and tjs baidu will return undefined
if (youdao) { if (youdao) {
...@@ -77,11 +77,15 @@ async function translateValue(value, api) { ...@@ -77,11 +77,15 @@ async function translateValue(value, api) {
} }
return result.result return result.result
}).catch(x => logger.error(`${youdao}炸了`, x)) }).catch(x => logger.error(`${api}炸了`, x))
// Promise.reject("bad youdao fanyi no get \\n") // Promise.reject("bad youdao fanyi no get \\n")
} }
return result.result if(value.length != result.result.length){
throw new Error(`${api}-error ${result.result.length}/${value.length}`)
}
return []
}).catch(err => { }).catch(err => {
throw err throw err
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册