Skip to content

4anghyeon(4주차): 4장 비동기 프로그래밍 정리 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 4anghyeon/4장 비동기 프로그래밍.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,11 @@ async function calcTotalHeight(urls: string[]) {

```typescript
try {
const height = await getTotalHeight(urls);
// ...
} catch (e) {
console.error(e);
}
const height = await getTotalHeight(urls);
// ...
} catch (e) {
console.error(e);
}
```

이러한 접근 방식은 순수 함수를 작성하는데 유리하며 부수 효과르 관리하기도 용이하다. 에러 핸들링은 에러가 발생하는 맥락에 가깝게 작성해야 효과적이다.
Expand Down