Class VaultClientResponseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.vault.VaultException
org.springframework.vault.client.VaultClientResponseException
- All Implemented Interfaces:
Serializable
Abstract base class for exceptions thrown by
VaultClient and
ReactiveVaultClient in case a request fails because of a server error
response, a failure to decode the response, or a low level I/O error.
Server error responses are determined by
status handlers for
RestClient, and by ResponseErrorHandler for
RestTemplate.
- Since:
- 4.1
- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate aVaultClientResponseExceptionwith the specified detail message.VaultClientResponseException(String msg, @Nullable Throwable cause) Create aVaultClientResponseExceptionwith the specified detail message and nested exception. -
Method Summary
Modifier and TypeMethodDescriptionabstract <E> @Nullable EgetResponseBodyAs(Class<E> targetType) Convert the error response content to the specified type.abstract <E> @Nullable EgetResponseBodyAs(ParameterizedTypeReference<E> targetType) Variant ofgetResponseBodyAs(Class)withParameterizedTypeReference.abstract byte[]Return the response body as a byte array.Return the response body converted to String.abstract StringgetResponseBodyAsString(Charset fallbackCharset) Return the response body converted to String.Return the HTTP response headers.abstract HttpStatusCodeReturn the HTTP status code.abstract StringReturn the HTTP status text.toString()Methods inherited from class NestedRuntimeException
contains, getMostSpecificCause, getRootCauseMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
VaultClientResponseException
Create aVaultClientResponseExceptionwith the specified detail message.- Parameters:
msg- the detail message.
-
VaultClientResponseException
-
-
Method Details
-
getStatusCode
Return the HTTP status code. -
getStatusText
Return the HTTP status text. -
getResponseHeaders
Return the HTTP response headers. -
getResponseBodyAsByteArray
public abstract byte[] getResponseBodyAsByteArray()Return the response body as a byte array. -
getResponseBodyAsString
Return the response body converted to String. The charset used is that of the response "Content-Type" or otherwise"UTF-8". -
getResponseBodyAsString
-
getResponseBodyAs
-
getResponseBodyAs
Variant ofgetResponseBodyAs(Class)withParameterizedTypeReference. -
toString
-