Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3630

Spring REST call: Do not return detailed error messages

$
0
0

Security experts gave me the hint to avoid returning internal structures in case of any errors. If for example an invalid date format is given, only the 400 error should be sent back to the caller but no detailed message:

"timestamp": "2024-05-25T06:08:37.483+00:00",  "status": 400,  "error": "Bad Request",  "message": "Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.PathVariable @org.springframework.format.annotation.DateTimeFormat java.time.LocalDate] for value [xxxx]",  "path": "/test/xxxx"

Is there a way to configure this in spring boot?


Viewing all articles
Browse latest Browse all 3630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>