반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 카프카
- 스프링부트
- 프로그래머스
- K8S
- 자료구조공부
- 기술면접공부
- Kafka
- Flutter
- 스프링공부
- 알고리즘공부
- JPA
- JPA스터디
- DDD
- JPA공부
- 스프링 공부
- nestjs공부
- 코테준비
- 코테공부
- nestjs스터디
- 플러터 공부
- 자바공부
- Axon framework
- JPA예제
- 기술공부
- nestjs
- 스프링
- JPA 공부
- querydsl
- 스프링부트공부
- 플러터 개발
Archives
- Today
- Total
목록nestJs 예외 (1)
DevBoi
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bVTAS0/btshy7JntfC/FEX37casep9qxgaFpaFv1K/img.png)
그냥 뭐.. 정의 된 예외를 던져주면된다. 스프링이랑 이건 뭐 거의 동일하다. getBoardById(id: string) : Board{ const board = this.boards.find((board) => board.id == id); if(!board) throw new NotFoundException(); return board } throw new NotFoundException("Not Found Exception"); 이렇게 하면 Exception message까지 가능하다. 이렇게 확인까지 가능하다. 생각보다 간편하다. ExceptionHandler 기능을 하는것도 있을것같은데...무튼 그렇다. ExceptionHandler라기 보다는, 글로벌하기 파이프를 연결 하면.. 가능할 것같다..
Develop/[NestJs]
2023. 5. 27. 17:56