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 | 29 | 30 | 31 |
Tags
- handleMethodsArgumentNotValid
- AWS
- header
- The Internet
- KOSDAQ
- API
- Version Control
- Stock
- WebServer
- mime type
- request param
- ExceptionHandler
- Slack
- Creon
- pyinstaller
- mongodb
- spec
- Instance
- Daishin Securities
- AESCipher
- stock trading
- automated system
- RecursionError: maximum recursion depth exceeded while calling a Python object
- URI
- python
- Auto Login
- EC2
- Rest
- Web Crawler
- creon login
Archives
- Today
- Total
Change the Better World
Why @ExceptionHandler(Exception.class) would not catch handleMethodsArgumentNotValid? 본문
REST
Why @ExceptionHandler(Exception.class) would not catch handleMethodsArgumentNotValid?
white_cheetah 2022. 9. 30. 10:40When a exceptionhandler is inherited from ResponseEntityExceptionHadler, we expect that @ExceptionHadler(Exception.class) is used to catch All exceptions.
But if MethodArgumentNotValidException is faced, our expectation misses our tip because the Exception wouldn't handle it.
This MethodArgumentNotValidException is used and handled with at ResponseEntityExceptionHadler so when an exception happened.
The MethodArgumentNotValidException or any kind of exception in ResponseEntityExceptionHadler is controlled by ResponseEntityExceptionHadler rather than the child exception which is inherited. If ResponseEntityExceptionHadler couldn't handle it, then @ExceptionHadler(Exception.class) will handle it.

'REST' 카테고리의 다른 글
| How to control version? (0) | 2022.09.30 |
|---|---|
| RESTful Web Service (0) | 2022.09.26 |
Comments