Skip to content

[번역]Part1 10.1 오류 다시 던지기 추가된 영문 번역#799

Closed
kbpark wants to merge 6 commits intojavascript-tutorial:masterfrom
kbpark:master
Closed

[번역]Part1 10.1 오류 다시 던지기 추가된 영문 번역#799
kbpark wants to merge 6 commits intojavascript-tutorial:masterfrom
kbpark:master

Conversation

@kbpark
Copy link
Contributor

@kbpark kbpark commented Aug 29, 2020

Pull Request 체크리스트

TODO

  • 번역 규칙을 확인하셨나요?
    • 줄 바꿈과 단락을 '원문과 동일하게' 유지하셨나요?
    • 맞춤법 검사기로 맞춤법을 확인하셨나요?
    • 마크다운 문법에 사용되는 공백(스페이스), 큰따옴표("), 작은따옴표('), 대시(-), 백틱(`) 등의 특수문자는 그대로 두셨나요?
  • 로컬 서버 세팅 후 최종 결과물을 확인해 보셨나요?
  • PR 하나엔 번역문 하나만 넣으셨나요?
  • 의미 있는 커밋 메시지를 작성하셨나요?
    • 예시
      • [프락시] 번역
      • [프락시] 과제 번역
      • [if문과 조건부 연산자 '?'] 리뷰
      • [주석] 2차 리뷰
      • [Date 객체와 날짜] 번역

@CLAassistant
Copy link

CLAassistant commented Aug 29, 2020

CLA assistant check
All committers have signed the CLA.

@kbpark kbpark closed this Aug 29, 2020
@kbpark kbpark reopened this Aug 29, 2020
Copy link
Member

@Violet-Bora-Lee Violet-Bora-Lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오랫만에 오셨네요!
환영합니다 👍

몇가지 코멘트 달아보았습니다.

위에선 '불완전한 데이터'를 다루려는 목적으로 `try..catch`를 썼습니다. 그런데 `catch`는 원래 `try` 블록에서 발생한 *모든* 에러를 잡으려는 목적으로 만들어졌습니다. 그런데 위 예시에서 `catch`는 예상치 못한 에러를 잡아내 주긴 했지만, 에러 종류와 관계없이 `"JSON Error"` 메시지를 보여줍니다. 이렇게 에러 종류와 관계없이 동일한 방식으로 에러를 처리하는 것은 디버깅을 어렵게 만들기 때문에 좋지 않습니다.

To avoid such problems, we can employ the "rethrowing" technique. The rule is simple:
이런 문제를 피하고자, '다시 던지기(rethrowing)" 기술을 사용합니다. 규칙은 간단합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
이런 문제를 피하고자, '다시 던지기(rethrowing)" 기술을 사용합니다. 규칙은 간단합니다.
이런 문제를 피하고자 '다시 던지기(rethrowing)' 기술을 사용합니다. 규칙은 간단합니다.

따옴표 관련 모범사례 확인부탁드립니다.
https://github.com/javascript-tutorial/ko.javascript.info/wiki/%EB%B2%88%EC%97%AD-%EB%AA%A8%EB%B2%94-%EC%82%AC%EB%A1%80#%EA%B0%95%EC%A1%B0%EC%9D%B8%EC%9A%A9%EC%8B%9C-%EC%82%AC%EC%9A%A9%EB%90%98%EB%8A%94-%EB%94%B0%EC%98%B4%ED%91%9C

**Cathch는 알고 있는 에러만 처리하고 나머지는 다시 던져야 합니다.**

The "rethrowing" technique can be explained in more detail as:
"다시 던지기(rethrowing)" 기술을 더 자세히 설명하겠습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

따옴표 모범사례 확인해주세요.

이런 문제를 피하고자, '다시 던지기(rethrowing)" 기술을 사용합니다. 규칙은 간단합니다.

**Catch should only process errors that it knows and "rethrow" all others.**
**Cathch는 알고 있는 에러만 처리하고 나머지는 다시 던져야 합니다.**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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가 모든 에러를 받습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`를 합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. 에러 처리 방법을 알지 못하면, `throw err`를 합니다.
3. 에러 처리 방법을 알지 못하면 `throw err`를 합니다.

https://github.com/javascript-tutorial/ko.javascript.info/wiki/%EB%B2%88%EC%97%AD-%EB%AA%A8%EB%B2%94-%EC%82%AC%EB%A1%80#%EC%89%BC%ED%91%9C%EB%A5%BC-%EB%AA%A8%EB%91%90-%EC%98%AE%EA%B8%B8-%ED%95%84%EC%9A%94%EB%8A%94-%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4

쉼표 모범사례 확인부탁드립니다.

if (err instanceof ReferenceError) {
*/!*
alert('ReferenceError'); // "ReferenceError" for accessing an undefined variable
alert('ReferenceError'); // 정의되지 않은 변수에 접근하여 "ReferenceError" 발생
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

따옴표 모범사례 확인

```

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`를 사용할 수도 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`err.name` 프로퍼티로 에러 클래스 이름을 알 수도 있습니다. 기본형 에러는 모두 이 프로퍼티를 가집니다. 또는 `err.constructor.name` 사용할 수도 있습니다.
`err.name` 프로퍼티로 에러 클래스 이름을 알 수도 있습니다. 기본형 에러는 모두 이 프로퍼티를 가집니다. 또는 `err.constructor.name` 사용할 수도 있습니다.

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

kbpark added 2 commits August 30, 2020 16:02
[오타수정]Part1 10.1 추가된 영문 번역 후 맞춤법 및 오타 수정
@kbpark kbpark closed this Aug 30, 2020
@kbpark
Copy link
Contributor Author

kbpark commented Aug 30, 2020

새로 Pull Request 하였습니다^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants