Class ApiRestException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.helidon.integrations.common.rest.ApiException
-
- io.helidon.integrations.common.rest.ApiRestException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OciRestException
,RestException
,VaultRestException
public abstract class ApiRestException extends ApiException
Exception when invoking remote REST API caused by wrong response from the API call. This exception means the API was invoked, we got a response back, but the status of the response was not valid for the invoked request. Each implementation is expected to extend this class and its builder to provide better details for the integrated system (such as system specific error messages).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApiRestException.BaseBuilder<B extends ApiRestException.BaseBuilder<B>>
Base builder extended by specific builder class.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ApiRestException(ApiRestException.BaseBuilder<?> builder)
Create a new instance using base builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
apiSpecificError()
API specific error message if such is available.Headers
headers()
Response HTTP headers.String
requestId()
Request ID used to invoke the request.Http.ResponseStatus
status()
Returned HTTP status.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ApiRestException
protected ApiRestException(ApiRestException.BaseBuilder<?> builder)
Create a new instance using base builder.- Parameters:
builder
- builder
-
-
Method Detail
-
status
public Http.ResponseStatus status()
Returned HTTP status.- Returns:
- status
-
requestId
public String requestId()
Request ID used to invoke the request. This may have been generated byRestApi
.- Returns:
- request ID
-
apiSpecificError
public Optional<String> apiSpecificError()
API specific error message if such is available.- Returns:
- api specific error, probably obtained from a header or entity
-
headers
public Headers headers()
Response HTTP headers.- Returns:
- headers
-
-