[bindings d-e] Fix exception handling (Jetty HTTP client) (#10476)

Fixes #10474

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo
2021-04-06 17:37:19 +02:00
committed by GitHub
parent fed460218e
commit 8ab37ce285
20 changed files with 73 additions and 62 deletions

View File

@@ -191,9 +191,13 @@ public class EtherRainCommunication {
logger.warn("Etherrain return status other than HTTP_OK : {}", response.getStatus());
return Collections.emptyList();
}
} catch (InterruptedException | TimeoutException | ExecutionException e) {
} catch (TimeoutException | ExecutionException e) {
logger.warn("Could not connect to Etherrain with exception: {}", e.getMessage());
return Collections.emptyList();
} catch (InterruptedException e) {
logger.warn("Connect to Etherrain interrupted: {}", e.getMessage());
Thread.currentThread().interrupt();
return Collections.emptyList();
}
return new BufferedReader(new StringReader(response.getContentAsString())).lines().collect(Collectors.toList());