From 29776f459e70425cd3c74b30e4d2b925209e5756 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Mon, 25 Sep 2017 20:35:37 +0200 Subject: [PATCH] Fixed Exception class on invalid response during sealStatus() --- .../java/de/stklcode/jvault/connector/HTTPVaultConnector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/stklcode/jvault/connector/HTTPVaultConnector.java b/src/main/java/de/stklcode/jvault/connector/HTTPVaultConnector.java index c9a991f..fa7176c 100644 --- a/src/main/java/de/stklcode/jvault/connector/HTTPVaultConnector.java +++ b/src/main/java/de/stklcode/jvault/connector/HTTPVaultConnector.java @@ -217,7 +217,7 @@ public class HTTPVaultConnector implements VaultConnector { String response = requestGet(PATH_SEAL_STATUS, new HashMap<>()); return jsonMapper.readValue(response, SealResponse.class); } catch (IOException e) { - throw new InvalidRequestException(Error.PARSE_RESPONSE, e); + throw new InvalidResponseException(Error.PARSE_RESPONSE, e); } catch (URISyntaxException ignored) { /* this should never occur and may leak sensible information */ throw new InvalidRequestException(Error.URI_FORMAT); @@ -849,7 +849,7 @@ public class HTTPVaultConnector implements VaultConnector { if (!er.getErrors().isEmpty() && er.getErrors().get(0).equals("permission denied")) throw new PermissionDeniedException(); throw new InvalidResponseException(Error.RESPONSE_CODE, - response.getStatusLine().getStatusCode(), er.toString()); + response.getStatusLine().getStatusCode(), er.getErrors().get(0)); } catch (IOException ignored) { // Exception ignored. }