Search in sources :

Example 6 with RestFailure

use of com.peterphi.std.guice.restclient.jaxb.RestFailure in project stdlib by petergeneric.

the class RemoteExceptionClientResponseFilter method parseResponse.

private RestFailure parseResponse(InputStream stream) throws IOException, JAXBException {
    stream.reset();
    final JAXBContext ctx = jaxbContextResolver.getContext(RestFailure.class);
    final JAXBElement<RestFailure> el = ctx.createUnmarshaller().unmarshal(new StreamSource(stream), RestFailure.class);
    return el.getValue();
}
Also used : RestFailure(com.peterphi.std.guice.restclient.jaxb.RestFailure) StreamSource(javax.xml.transform.stream.StreamSource) JAXBContext(javax.xml.bind.JAXBContext)

Aggregations

RestFailure (com.peterphi.std.guice.restclient.jaxb.RestFailure)6 RestException (com.peterphi.std.guice.restclient.exception.RestException)2 JAXBContext (javax.xml.bind.JAXBContext)2 StreamSource (javax.xml.transform.stream.StreamSource)2 ApplicationException (org.jboss.resteasy.spi.ApplicationException)2 ExceptionInfo (com.peterphi.std.guice.restclient.jaxb.ExceptionInfo)1 RestFailureMarshaller (com.peterphi.std.guice.web.rest.jaxrs.exception.RestFailureMarshaller)1 TwitterBootstrapRestFailurePageRenderer (com.peterphi.std.guice.web.rest.pagewriter.TwitterBootstrapRestFailurePageRenderer)1 InputStream (java.io.InputStream)1 StringReader (java.io.StringReader)1 Date (java.util.Date)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 ResponseProcessingException (javax.ws.rs.client.ResponseProcessingException)1 Response (javax.ws.rs.core.Response)1 ClientResponse (org.jboss.resteasy.client.jaxrs.internal.ClientResponse)1 JAXBUnmarshalException (org.jboss.resteasy.plugins.providers.jaxb.JAXBUnmarshalException)1 UnhandledException (org.jboss.resteasy.spi.UnhandledException)1