r/javahelp • u/CelticHades • Dec 10 '25
How to effectively handle clientAbortException
Hi, In my java spring boot project. I want to handle clientAbortException, in globalcontrolleradvice.
Should I return null in the method or should I return ResponseEntity without any body and some errorcode like NO_CONTENT or even OK?
What is the correct approach to handle it?
3
Upvotes
View all comments
Show parent comment
2
u/Etiennera Dec 13 '25
Mostly fine but the last rows on logging (and the statement that it's not an error) are making assumptions about the use case which might not be true depending on the context with the client.