Skip to content

Commit

Permalink
Consistently attach cause to exceptions.
Browse files Browse the repository at this point in the history
Closes gh-713
  • Loading branch information
mp911de committed Mar 17, 2023
1 parent 73af381 commit aeaf571
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static Map<String, Object> lookupSelf(RestOperations restOperations, Vau
}
catch (HttpStatusCodeException e) {
throw new VaultTokenLookupException(String.format("Token self-lookup failed: %s %s", e.getRawStatusCode(),
VaultResponses.getError(e.getResponseBodyAsString())));
VaultResponses.getError(e.getResponseBodyAsString())), e);
}
catch (RestClientException e) {
throw new VaultTokenLookupException("Token self-lookup failed", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static VaultLoginException create(String authMethod, Throwable cause) {
String.format("Cannot login using %s: %s", authMethod, VaultResponses.getError(response)), cause);
}

return new VaultLoginException(String.format("Cannot login using %s", cause));
return new VaultLoginException(String.format("Cannot login using %s", cause), cause);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public V get() {
return get0();
}

throw new VaultException(this.exception.getMessage());
throw new VaultException(this.exception.getMessage(), this.exception);
}

/**
Expand Down

0 comments on commit aeaf571

Please sign in to comment.