Optional<Throwable> t = Optional.ofNullable(m.toThrowable(response)); errors.put(t, i); });
Optional<Throwable> t = Optional.ofNullable(m.toThrowable(response)); errors.put(t, i); });
@Override protected void checkResponse(Method m, Response r, Message inMessage) throws Throwable { MicroProfileClientProviderFactory factory = MicroProfileClientProviderFactory.getInstance(inMessage); List<ResponseExceptionMapper<?>> mappers = factory.createResponseExceptionMapper(inMessage, Throwable.class); for (ResponseExceptionMapper<?> mapper : mappers) { if (mapper.handles(r.getStatus(), r.getHeaders())) { Throwable t = mapper.toThrowable(r); if (t instanceof RuntimeException) { throw t; } else if (t != null && m.getExceptionTypes() != null) { // its a checked exception, make sure its declared for (Class<?> c : m.getExceptionTypes()) { if (t.getClass().isAssignableFrom(c)) { throw t; } } // TODO Log the unhandled declarable } } } }
Optional<Throwable> t = Optional.ofNullable(m.toThrowable(response)); errors.put(t, i); });
@Override protected void checkResponse(Method m, Response r, Message inMessage) throws Throwable { MicroProfileClientProviderFactory factory = MicroProfileClientProviderFactory.getInstance(inMessage); List<ResponseExceptionMapper<?>> mappers = factory.createResponseExceptionMapper(inMessage, Throwable.class); for (ResponseExceptionMapper<?> mapper : mappers) { if (mapper.handles(r.getStatus(), r.getHeaders())) { Throwable t = mapper.toThrowable(r); if (t instanceof RuntimeException) { throw t; } else if (t != null && m.getExceptionTypes() != null) { // its a checked exception, make sure its declared for (Class<?> c : m.getExceptionTypes()) { if (t.getClass().isAssignableFrom(c)) { throw t; } } // TODO Log the unhandled declarable } } } }
Optional<Throwable> t = Optional.ofNullable(m.toThrowable(response)); errors.put(t, i); });
Optional<Throwable> t = Optional.ofNullable(m.toThrowable(response)); errors.put(t, i); });