Skip to content

Commit 1d0ff1f

Browse files
committed
Consistently attach cause to exceptions.
Closes gh-713
1 parent 658ec58 commit 1d0ff1f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

spring-vault-core/src/main/java/org/springframework/vault/authentication/LoginTokenAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static Map<String, Object> lookupSelf(RestOperations restOperations, Vau
9090
}
9191
catch (HttpStatusCodeException e) {
9292
throw new VaultTokenLookupException(String.format("Token self-lookup failed: %s %s", e.getStatusCode(),
93-
VaultResponses.getError(e.getResponseBodyAsString())));
93+
VaultResponses.getError(e.getResponseBodyAsString())), e);
9494
}
9595
catch (RestClientException e) {
9696
throw new VaultTokenLookupException("Token self-lookup failed", e);

spring-vault-core/src/main/java/org/springframework/vault/authentication/VaultLoginException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static VaultLoginException create(String authMethod, Throwable cause) {
6161
String.format("Cannot login using %s: %s", authMethod, VaultResponses.getError(response)), cause);
6262
}
6363

64-
return new VaultLoginException(String.format("Cannot login using %s", cause));
64+
return new VaultLoginException(String.format("Cannot login using %s", cause), cause);
6565
}
6666

6767
}

spring-vault-core/src/main/java/org/springframework/vault/support/AbstractResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public V get() {
8282
return get0();
8383
}
8484

85-
throw new VaultException(this.exception.getMessage());
85+
throw new VaultException(this.exception.getMessage(), this.exception);
8686
}
8787

8888
/**

0 commit comments

Comments
 (0)