Last active
October 30, 2017 09:33
-
-
Save dinolupo/d742a3ff8406c425e46e4573cbed5e34 to your computer and use it in GitHub Desktop.
How to manage Exceptions in Java EE Rest Services .
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
import javax.ejb.ApplicationException; | |
import javax.ws.rs.WebApplicationException; | |
import javax.ws.rs.core.Response; | |
/** | |
* | |
* @author Dino Lupo | |
*/ | |
@ApplicationException(rollback = true) | |
public class TestWebException extends WebApplicationException { | |
public TestWebException(String message) { | |
super(Response.status(400).header("additional-info", message).build()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment