| 108 | } |
| 109 | |
| 110 | private static void throwInnerException(Exception e) throws VaasAuthenticationException, VaasClientException, VaasServerException { |
| 111 | var inner = e.getCause(); |
| 112 | if (inner instanceof VaasAuthenticationException) { |
| 113 | throw new VaasAuthenticationException(e.getMessage(), inner); |
| 114 | } else if (inner instanceof VaasClientException) { |
| 115 | throw new VaasClientException(e.getMessage(), inner); |
| 116 | } |
| 117 | throw new VaasServerException(e.getMessage(), inner); |
| 118 | } |
| 119 | |
| 120 | private CompletableFuture<VaasVerdict> sendUrlWithRetry(HttpClient httpClient, URI uri, String vaasRequestId) { |
| 121 | return createHttpRequestBuilderWithHeaders(uri, vaasRequestId).thenCompose(request -> |