We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a42e844 commit 86f5609Copy full SHA for 86f5609
1-js/10-error-handling/2-custom-errors/article.md
@@ -247,7 +247,7 @@ try {
247
2. 函数`readUser` 将捕获内部发生的数据读取 error,例如 `ValidationError` 和 `SyntaxError`,并生成一个 `ReadError` 来进行替代。
248
3. 对象 `ReadError` 会把对原始 error 的引用保存在其 `cause` 属性中。
249
250
-之后,调用 `readUser` 的代码只需要检查 `ReadError`,而不必检查每种数据读取 error。并且,如果需要更多 error 细节,那么可以检查 `readUser` 的 `cause` 属性。
+之后,调用 `readUser` 的代码只需要检查 `ReadError`,而不必检查每种数据读取 error。并且,如果需要更多 error 细节,那么可以检查 `ReadError` 对象的 `cause` 属性。
251
252
下面的代码定义了 `ReadError`,并在 `readUser` 和 `try..catch` 中演示了其用法:
253
0 commit comments