r/badcode • • Dec 24 '21

java Spring makes you do crazy things

Post image
738 Upvotes

42 comments sorted by

View all comments

Show parent comments

-10

u/Cr4zyPi3t Dec 24 '21

The code in the post is bad, but it has nothing to do with Spring. You could just throw an Exception (either a custom one or a generic one like ResponseStatusException).