Interface ExceptionProvider
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.27.0")
public interface ExceptionProvider
Extension point for customizing exceptions thrown by the generated API client.
The default implementation throws RuntimeException. To use custom exception
types, implement this interface and pass the instance to
ApiClient.setExceptionProvider(ExceptionProvider).
apiClient.setExceptionProvider(new ExceptionProvider() {
public RuntimeException bearerAuthException() {
return new MyAuthException("No Bearer authentication configured!");
}
});
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExceptionProviderThe defaultExceptionProviderinstance. -
Method Summary
Modifier and TypeMethodDescriptiondefault RuntimeExceptionReturns an exception indicating that no API key authentication is configured.default RuntimeExceptionReturns an exception indicating that no Bearer authentication is configured.default RuntimeExceptionWraps a date/time parse exception.default RuntimeExceptionReturns an exception indicating that no HTTP basic authentication is configured.default RuntimeExceptionWraps a Jackson serialization/deserialization exception.default RuntimeExceptionReturns an exception indicating that no OAuth2 authentication is configured.default org.springframework.web.client.RestClientExceptionundefinedAuthenticationException(String authName) Returns an exception indicating that the requested authentication scheme is not configured.
-
Field Details
-
DEFAULT
The defaultExceptionProviderinstance.
-
-
Method Details
-
bearerAuthException
Returns an exception indicating that no Bearer authentication is configured. -
httpBasicAuthException
Returns an exception indicating that no HTTP basic authentication is configured. -
apiKeyAuthException
Returns an exception indicating that no API key authentication is configured. -
oAuth2Exception
Returns an exception indicating that no OAuth2 authentication is configured. -
dateTimeException
Wraps a date/time parse exception. -
jacksonException
Wraps a Jackson serialization/deserialization exception. -
undefinedAuthenticationException
default org.springframework.web.client.RestClientException undefinedAuthenticationException(String authName) Returns an exception indicating that the requested authentication scheme is not configured.- Parameters:
authName- the name of the authentication scheme that could not be found- Returns:
- a
RestClientExceptiondescribing the missing authentication
-