Answer the question
In order to leave comments, you need to log in
How to pass error message in http request?
Hey!
I have an exception I created:
@ResponseStatus(HttpStatus.CONFLICT)
public class UserAlreadyExistException extends RuntimeException{
public UserAlreadyExistException(String message) {
super(message);
}
}
if (userService.findByEmail(email) != null) {
throw new UserAlreadyExistException("User with this email already exist!");
}
MockHttpServletResponse:
Status = 409
Error message = null
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question