Skip to content

Commit

Permalink
调整requestRemoteTranslation 函数的翻译失败的错误输出信息
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Feb 14, 2025
1 parent 7d46bbf commit 54d5184
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,9 @@
console.log(result);
const translatedText = getNestedProperty(result, responseIdentifier) || '翻译失败';
resolve(translatedText);
} catch {
resolve('翻译失败');
} catch (err) {
console.error('翻译失败:', err);
resolve(`翻译失败(${err.type})`);
}
},
onerror: (err) => {
Expand Down

0 comments on commit 54d5184

Please sign in to comment.