Response.status(BAD_REQUEST).entity(ex.getCause().getMessage()).build();
Using exceptionObject.getCause().getMessage() will give us the single or one line error message.
This is very useful when you want to show the exact one line message to the user.
Using exceptionObject.getCause().getMessage() will give us the single or one line error message.
This is very useful when you want to show the exact one line message to the user.