codestates / codestates/NERDchat
[Error Handling] EXECABORT Transaction discarded because of previous errors.
- Dominant language
- No language data
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## 어떤 에러인가요?
* 문법 오류때문에 redis 코드가 실행이 되지 않았던 에러
* 문법 오류가 나는 경우에 multi() ~ exec() 코드에서 exec()가 실행되지 않는다.
* 에러 메시지
```
(node:56267) UnhandledPromiseRejectionWarning: ReplyError: EXECABORT Transaction discarded because of previous errors.
at parseError (/Users/byungheejeon/nodejs/NERDChat/server/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/Users/byungheejeon/nodejs/NERDChat/server/node_modules/redis-parser/lib/parser.js:302:14)
(node:56267) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
```
* 오류코드
```
deleteRoomUser (room) {
this.redisClient.multi()
.lrem(`roomUser:${room.uuid}`, room.user).exec();
}
```
## 에러 핸들링 방법
```
deleteRoomUser (room) {
this.redisClient.multi()
.lrem(`roomUser:${room.uuid}`, 1, room.user).exec();
}
```
* Redis에서 특정 키 값안에 특정한 데이터를 지우려면 LREM KEY INTEGER VALUE 가 되어야한다.
## 에러 핸들링을 위해 참고한 레퍼런스 링크
[Link](https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=kwoncharlie&logNo=10189005006)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.