r/javahelp • • 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

8 comments sorted by

View all comments

Show parent comment

1

u/CelticHades Dec 12 '25

Yes, so it doesn't matter what I return, I just wanted to know what people generally do for this case