I have a simple spring boot application in which I have alot of tables. I have build their models, repositories, service and controller files. I have also tested all the apis through postman. Now I need to implement custom exception in my models. Since I am at the beginning stage and learning things, I am a little confused as to how can I apply exceptions?
From what I have explored, I need to create three files
ErrorDetails.java
GlobalExceptionHandler.java
ResourceNotFoundException.java
Is this correct? If yes suppose I have added these files in my project . How do I implement these exceptions in my apis? Can anybody help me? Would mean alot. Thanks!