Skip to content

Commit 86f5609

Browse files
authored
fix: minor typo (#1249)
1 parent a42e844 commit 86f5609

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/10-error-handling/2-custom-errors/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ try {
247247
2. 函数`readUser` 将捕获内部发生的数据读取 error,例如 `ValidationError``SyntaxError`,并生成一个 `ReadError` 来进行替代。
248248
3. 对象 `ReadError` 会把对原始 error 的引用保存在其 `cause` 属性中。
249249
250-
之后,调用 `readUser` 的代码只需要检查 `ReadError`,而不必检查每种数据读取 error。并且,如果需要更多 error 细节,那么可以检查 `readUser` `cause` 属性。
250+
之后,调用 `readUser` 的代码只需要检查 `ReadError`,而不必检查每种数据读取 error。并且,如果需要更多 error 细节,那么可以检查 `ReadError` 对象的 `cause` 属性。
251251
252252
下面的代码定义了 `ReadError`,并在 `readUser``try..catch` 中演示了其用法:
253253

0 commit comments

Comments
 (0)