codestates / codestates/BanThing

[Error Handling] typeScript의 오류

Open
#139 0 comments 0 reactions 1 assignee Claimed by @tmdqls2257 View on GitHub
client error solved
Dominant language
TypeScript
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### 어떤 에러인가요?
![image](https://user-images.githubusercontent.com/54207332/155055740-b4e538e2-2018-4e63-a222-1a177dcf4dc2.png)

- typescript에서 작업을 하다보면 나오는 에러이다.
```
$ 터미널의 에러 코드를 여기 넣어주세요.
```

### 에러 핸들링 방법
- falsy한 값인지 혹은 truthy한 값인지를 체크하는 코드입니다.
```
if (onClick) {
axios.post(`http://localhost:80/rooms`, {
title: onClick[0],
category: onClick[1],
content: onClick[2],
host_roll: Number(onClick[3]),
});
}
```

### 에러 핸들링을 위해 참고한 레퍼런스 링크
- Memory-It 의 Error Handling 예시입니다.
[링크](https://github.com/codestates/Memory-It/issues/205)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.