アノテーション @ExceptionHandler を使用するときに例外オブジェクトに入る方法はありますか?
これは私のコードです:
@ExceptionHandler(DataInputException.class)
public ResponseEntity handleException(){
return ResponseEntity
.status(HttpStatus.BAD_REQUEST)
.body("Entity contains null or forbidden values");
}
特定のフィールドに関するカスタマイズされた情報を含むメッセージを返したいと思います。(そのため、エラー オブジェクトが必要です)。