Apache CXF API

org.apache.cxf.jaxrs.client
Class ServerWebApplicationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.ws.rs.WebApplicationException
                  extended by 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

Constructor Summary
ServerWebApplicationException()
           
ServerWebApplicationException(javax.ws.rs.core.Response response)
           
ServerWebApplicationException(Throwable cause, javax.ws.rs.core.Response response)
           
 
Method Summary
 javax.ws.rs.core.MultivaluedMap<String,String> getHeaders()
           
 String getMessage()
           
 javax.ws.rs.core.Response getResponse()
           
 int getStatus()
           
<T> T
toErrorObject(Client client, Class<T> entityCls)
          Returns the typed error message
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerWebApplicationException

public ServerWebApplicationException()

ServerWebApplicationException

public ServerWebApplicationException(javax.ws.rs.core.Response response)

ServerWebApplicationException

public ServerWebApplicationException(Throwable cause,
                                     javax.ws.rs.core.Response response)
Method Detail

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 client
cls - the entity class
Returns:
the typed entity

Apache CXF API

Apache CXF