@Override public ResteasyClientException toException(Exception exception) { if (exception instanceof IOException) { return mapIOException(IOException.class.cast(exception)); } if (exception instanceof HttpException) { return mapHttpException(HttpException.class.cast(exception)); } return new ResteasyClientException("Unexpected exception type", exception); }
static synchronized private void checkClientExceptionMapper() { if (ResteasyProviderFactory.getInstance().getClientExceptionMapper(Exception.class) == null) { Type exceptionType = Types.getActualTypeArgumentsOfAnInterface(ApacheHttpClient4ExceptionMapper.class, ClientExceptionMapper.class)[0]; ResteasyProviderFactory.getInstance().addClientExceptionMapper(new ApacheHttpClient4ExceptionMapper(), exceptionType); } }
if (mapper != null) throw mapper.toException(e);
static synchronized private void checkClientExceptionMapper() { ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); if (factory instanceof org.jboss.resteasy.spi.old.ResteasyProviderFactory) { org.jboss.resteasy.spi.old.ResteasyProviderFactory f = (org.jboss.resteasy.spi.old.ResteasyProviderFactory)factory; if (f.getClientExceptionMapper(Exception.class) == null) { Type exceptionType = Types.getActualTypeArgumentsOfAnInterface(ApacheHttpClient4ExceptionMapper.class, ClientExceptionMapper.class)[0]; f.addClientExceptionMapper(new ApacheHttpClient4ExceptionMapper(), exceptionType); } } }
if (mapper != null) throw mapper.toException(e);
@Override public ResteasyClientException toException(Exception exception) { if (exception instanceof IOException) { return mapIOException(IOException.class.cast(exception)); } if (exception instanceof HttpException) { return mapHttpException(HttpException.class.cast(exception)); } return new ResteasyClientException("Unexpected exception type", exception); }
_providerFactory.addClientExceptionMapper(new ApacheHttpClient4ExceptionMapper(), exceptionType);
ClientExceptionMapper<Exception> mapper = _providerFactory.getClientExceptionMapper(Exception.class); if (mapper != null) { throw mapper.toException(e); } else { throw new RuntimeException(e);
_providerFactory.addClientExceptionMapper(new ApacheHttpClient4ExceptionMapper(), exceptionType);
ClientExceptionMapper<Exception> mapper = _providerFactory.getClientExceptionMapper(Exception.class); if (mapper != null) { throw mapper.toException(e); } else { throw new RuntimeException(e);