Merge pull request 'retry on UnknownHostException' (#469) from retry_on_UnknownHostException into main

Reviewed-on: #469
This commit is contained in:
Claudio Atzori 2024-09-25 11:35:14 +02:00
commit c1a309df75
1 changed files with 2 additions and 2 deletions

View File

@ -214,11 +214,11 @@ public class HttpConnector2 {
.format(
"Unexpected status code: %s errors: %s", urlConn.getResponseCode(),
MAPPER.writeValueAsString(report)));
} catch (MalformedURLException | UnknownHostException e) {
} catch (MalformedURLException e) {
log.error(e.getMessage(), e);
report.put(e.getClass().getName(), e.getMessage());
throw new CollectorException(e.getMessage(), e);
} catch (SocketTimeoutException | SocketException e) {
} catch (SocketTimeoutException | SocketException | UnknownHostException e) {
log.error(e.getMessage(), e);
report.put(e.getClass().getName(), e.getMessage());
backoffAndSleep(getClientParams().getRetryDelay() * retryNumber * 1000);