org.apache.cxf.jaxrs.client
Class ServerWebApplicationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.ws.rs.WebApplicationException
org.apache.cxf.jaxrs.client.ServerWebApplicationException
- All Implemented Interfaces:
- Serializable
public class ServerWebApplicationException
- extends javax.ws.rs.WebApplicationException
Utility Exception class which makes it easier to get the response status,
headers and error message if any
- See Also:
- Serialized Form
ServerWebApplicationException
public ServerWebApplicationException()
ServerWebApplicationException
public ServerWebApplicationException(javax.ws.rs.core.Response response)
ServerWebApplicationException
public ServerWebApplicationException(Throwable cause,
javax.ws.rs.core.Response response)
getResponse
public javax.ws.rs.core.Response getResponse()
- Overrides:
getResponse
in class javax.ws.rs.WebApplicationException
getStatus
public int getStatus()
getHeaders
public javax.ws.rs.core.MultivaluedMap<String,String> getHeaders()
getMessage
public String getMessage()
- Overrides:
getMessage
in class Throwable
toString
public String toString()
- Overrides:
toString
in class Throwable
toErrorObject
public <T> T toErrorObject(Client client,
Class<T> entityCls)
- Returns the typed error message
- Parameters:
client
- the clientcls
- the entity class
- Returns:
- the typed entity
Apache CXF