I have actually a problem within my spring-boot application i developed a restful api linked to an s3 bucket i've customized some exceptions but when i run my url to get an object that doesn't exsit in the console i saw this error exception in my console :
2019-07-25 09:06:45.733 ERROR 1 --- [-nio-443-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: 60E24BCF6860FC66; S3 Extended Request ID: DUEnMWN7YZKug74Q15uHt4Zei3+a7SxTNYzoj99O0YW58WOwvkdM1kwYpcHrGJiTrLkRLOdUL5I=), S3 Extended Request ID: DUEnMWN7YPOAIZADg74Q15uHt4Zei3+a7SxTNYzoj99O0YW58WOwvkdM1kwYpcHrGJiTrLkRLOdUL5I=] with root cause
com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: 60E24BCF6860FC66; S3 Extended Request ID: DUEnMWN7YZKug74Q15uHt4ZDFSFSQSDei3+a7SxTNYzoj99O0YW58WOwvkdM1kwYpcHrGJiTrLkRLOdUL5I=)
So my question is how to perform customization to this error in 2 points:
- Not having this error showing in the console (technically I don't mean change log parameters)
- Handle this exception with some methods