Package com.sap.ai.sdk.foundationmodels.openai

# Class OpenAiClientException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.sap.ai.sdk.core.common.ClientException
com.sap.ai.sdk.foundationmodels.openai.OpenAiClientException

All Implemented Interfaces:
  `Serializable`

public class OpenAiClientException extends ClientException
Generic exception for errors occurring when using OpenAI foundation models.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OpenAiClientException()`
  `OpenAiClientException(String message)`
  `OpenAiClientException(String message, Throwable cause)`
  `OpenAiClientException(Throwable cause)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ErrorResponse`
  `getErrorResponse()`
  Retrieves the `ErrorResponse` from the OpenAI service, if available.

  ### Methods inherited from class com.sap.ai.sdk.core.common.ClientException

  `getClientError, getHttpRequest, getHttpResponse, setClientError, setHttpRequest, setHttpResponse`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### OpenAiClientException

    public OpenAiClientException()

  - ### OpenAiClientException

    public OpenAiClientException(String message)

  - ### OpenAiClientException

    public OpenAiClientException(Throwable cause)

  - ### OpenAiClientException

    public OpenAiClientException(String message, Throwable cause)

- ## Method Details

  - ### getErrorResponse

    @Beta @Nullable public ErrorResponse getErrorResponse()
    Retrieves the `ErrorResponse` from the OpenAI service, if available.
    Returns:
      The `ErrorResponse` object, or `null` if not available.