Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RuntimeException is not displaying the error message in postman

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.

like image 830
khalid hussein Avatar asked Oct 25 '25 00:10

khalid hussein


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)

like image 136
waf Avatar answered Oct 26 '25 15:10

waf