Consistently attach cause to exceptions.
Closes gh-713
This commit is contained in:
@@ -90,7 +90,7 @@ public class LoginTokenAdapter implements ClientAuthentication {
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -61,7 +61,7 @@ public class VaultLoginException extends VaultException {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public abstract class AbstractResult<V> {
|
||||
return get0();
|
||||
}
|
||||
|
||||
throw new VaultException(this.exception.getMessage());
|
||||
throw new VaultException(this.exception.getMessage(), this.exception);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user