RuntimeException is not displaying the error message in postman

Viewed 1224

I am using spring boot restful API every time I try

if(userRepository.findByEmail != null) Throw new RuntimeException("This email already exists");

I don't get the message back I only get the error with an empty message in postman instead I get only inside spring boot command the message I passed in RuntimeException.

1 Answers

They've changed this in Spring 2.3.0, to see the error message through postman you need to add server.error.include-message=always in your properties file (application.properties)

Related