In this short, I show a really clean way to send object through a service class in a restful Spring Boot application. This way allows you to send an actual entity/object through a service class while also being able to throw an exception, ResponseStatusException to be exact, with an HTTP status (404 or 500) and a message as to why it's being thrown.
#shorts