@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 Details

  • Method Details

    • bearerAuthException

      default RuntimeException bearerAuthException()
      Returns an exception indicating that no Bearer authentication is configured.
    • httpBasicAuthException

      default RuntimeException httpBasicAuthException()
      Returns an exception indicating that no HTTP basic authentication is configured.
    • apiKeyAuthException

      default RuntimeException apiKeyAuthException()
      Returns an exception indicating that no API key authentication is configured.
    • oAuth2Exception

      default RuntimeException oAuth2Exception()
      Returns an exception indicating that no OAuth2 authentication is configured.
    • dateTimeException

      default RuntimeException dateTimeException(ParseException e)
      Wraps a date/time parse exception.
    • jacksonException

      default RuntimeException jacksonException(Exception e)
      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 RestClientException describing the missing authentication