diff --git a/README.chinese.md b/README.chinese.md index 6089bafb..885f9195 100644 --- a/README.chinese.md +++ b/README.chinese.md @@ -92,26 +92,26 @@
-# `2. Error Handling Practices` +# `2. 错误处理最佳实践` -## ![✔] 2.1 Use Async-Await or promises for async error handling +## ![✔] 2.1 使用 Async-Await 和 promises 用于异步错误处理 -**TL;DR:** Handling async errors in callback style is probably the fastest way to hell (a.k.a the pyramid of doom). The best gift you can give to your code is using a reputable promise library or async-await instead which enables a much more compact and familiar code syntax like try-catch +**TL;DR:** 使用回调的方式处理异步错误可能是导致灾难的最快的方式(a.k.a the pyramid of doom)。对您的代码来说,最好的礼物就是使用规范的promise库或async-await来替代,这会使其像try-catch一样更加简洁,熟悉的代码结构。 -**Otherwise:** Node.JS callback style, function(err, response), is a promising way to un-maintainable code due to the mix of error handling with casual code, excessive nesting and awkward coding patterns +**否则:** Node.JS 回调特性, function(err, response), 是导致不可维护代码的一个必然的方式。究其原因,是由于混合了随意的错误处理代码,臃肿的内嵌,蹩脚的代码模式。 -🔗 [**Read More: avoiding callbacks**](/sections/errorhandling/asyncerrorhandling.md) +🔗 [**更多: 避免回调**](/sections/errorhandling/asyncerrorhandling.md)