[번역]Part1 10.1 오류 다시 던지기 추가된 영문 번역#799
Closed
kbpark wants to merge 6 commits intojavascript-tutorial:masterfrom
Closed
[번역]Part1 10.1 오류 다시 던지기 추가된 영문 번역#799kbpark wants to merge 6 commits intojavascript-tutorial:masterfrom
kbpark wants to merge 6 commits intojavascript-tutorial:masterfrom
Conversation
10 에러 핸들링 - 추가된 영문 번역(맞춤법 수정)
Violet-Bora-Lee
requested changes
Aug 30, 2020
Member
Violet-Bora-Lee
left a comment
There was a problem hiding this comment.
오랫만에 오셨네요!
환영합니다 👍
몇가지 코멘트 달아보았습니다.
| 위에선 '불완전한 데이터'를 다루려는 목적으로 `try..catch`를 썼습니다. 그런데 `catch`는 원래 `try` 블록에서 발생한 *모든* 에러를 잡으려는 목적으로 만들어졌습니다. 그런데 위 예시에서 `catch`는 예상치 못한 에러를 잡아내 주긴 했지만, 에러 종류와 관계없이 `"JSON Error"` 메시지를 보여줍니다. 이렇게 에러 종류와 관계없이 동일한 방식으로 에러를 처리하는 것은 디버깅을 어렵게 만들기 때문에 좋지 않습니다. | ||
|
|
||
| To avoid such problems, we can employ the "rethrowing" technique. The rule is simple: | ||
| 이런 문제를 피하고자, '다시 던지기(rethrowing)" 기술을 사용합니다. 규칙은 간단합니다. |
Member
There was a problem hiding this comment.
Suggested change
| 이런 문제를 피하고자, '다시 던지기(rethrowing)" 기술을 사용합니다. 규칙은 간단합니다. | |
| 이런 문제를 피하고자 '다시 던지기(rethrowing)' 기술을 사용합니다. 규칙은 간단합니다. |
| **Cathch는 알고 있는 에러만 처리하고 나머지는 다시 던져야 합니다.** | ||
|
|
||
| The "rethrowing" technique can be explained in more detail as: | ||
| "다시 던지기(rethrowing)" 기술을 더 자세히 설명하겠습니다. |
| 이런 문제를 피하고자, '다시 던지기(rethrowing)" 기술을 사용합니다. 규칙은 간단합니다. | ||
|
|
||
| **Catch should only process errors that it knows and "rethrow" all others.** | ||
| **Cathch는 알고 있는 에러만 처리하고 나머지는 다시 던져야 합니다.** |
Member
There was a problem hiding this comment.
Suggested change
| **Cathch는 알고 있는 에러만 처리하고 나머지는 다시 던져야 합니다.** | |
| **catch는 알고 있는 에러만 처리하고 나머지는 다시 던져야 합니다.** |
| 1. Catch gets all errors. | ||
| 2. In the `catch(err) {...}` block we analyze the error object `err`. | ||
| 3. If we don't know how to handle it, we do `throw err`. | ||
| 1. Catch가 모든 에러를 받습니다. |
Member
There was a problem hiding this comment.
Suggested change
| 1. Catch가 모든 에러를 받습니다. | |
| 1. catch가 모든 에러를 받습니다. |
| 3. If we don't know how to handle it, we do `throw err`. | ||
| 1. Catch가 모든 에러를 받습니다. | ||
| 2. `catch(err) {...}` 블록 안에서 에러 객체 `err`를 분석합니다. | ||
| 3. 에러 처리 방법을 알지 못하면, `throw err`를 합니다. |
Member
There was a problem hiding this comment.
Suggested change
| 3. 에러 처리 방법을 알지 못하면, `throw err`를 합니다. | |
| 3. 에러 처리 방법을 알지 못하면 `throw err`를 합니다. |
쉼표 모범사례 확인부탁드립니다.
| if (err instanceof ReferenceError) { | ||
| */!* | ||
| alert('ReferenceError'); // "ReferenceError" for accessing an undefined variable | ||
| alert('ReferenceError'); // 정의되지 않은 변수에 접근하여 "ReferenceError" 발생 |
| ``` | ||
|
|
||
| We can also get the error class name from `err.name` property. All native errors have it. Another option is to read `err.constructor.name`. | ||
| `err.name` 프로퍼티로 에러 클래스 이름을 알 수도 있습니다. 기본형 에러는 모두 이 프로퍼티를 가집니다. 또는 `err.constructor.name`를 사용할 수도 있습니다. |
Member
There was a problem hiding this comment.
Suggested change
| `err.name` 프로퍼티로 에러 클래스 이름을 알 수도 있습니다. 기본형 에러는 모두 이 프로퍼티를 가집니다. 또는 `err.constructor.name`를 사용할 수도 있습니다. | |
| `err.name` 프로퍼티로 에러 클래스 이름을 알 수도 있습니다. 기본형 에러는 모두 이 프로퍼티를 가집니다. 또는 `err.constructor.name`을 사용할 수도 있습니다. |
|
Please make the requested changes. After it, add a comment "/done". |
[오타수정]Part1 10.1 추가된 영문 번역 후 맞춤법 및 오타 수정
Contributor
Author
|
새로 Pull Request 하였습니다^^ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request 체크리스트
TODO