Last active
November 28, 2018 19:41
-
-
Save samuelcatalano-zz/085dd8b97619faf2eb6b1cd3b58644e2 to your computer and use it in GitHub Desktop.
Returning message error using javax.ws.rs.core.Response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//javax.ws.rs.core.Response return message error | |
// catch Expection | |
JsonObject error = new JsonObject(); | |
error.put("erro", e.getMessage()); | |
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(error.toString()).type(MediaType.APPLICATION_JSON).build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment