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

# Class OpenAiError

java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.OpenAiError

All Implemented Interfaces:
  `ClientError`

public final class OpenAiError extends Object implements ClientError
Represents an error response from the OpenAI API.

Since:
  1.4.0

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `OpenAiError(ErrorResponse errorResponse)`
  Creates a new `OpenAiError` instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `ErrorResponse`
  `getErrorResponse()`
  The original error response from the OpenAI API.
  `String`
  `getMessage()`
  Gets the error message from the contained original response.
  `int`
  `hashCode()`
  `String`
  `toString()`

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

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

- ## Constructor Details

  - ### OpenAiError

    protected OpenAiError(ErrorResponse errorResponse)
    Creates a new `OpenAiError` instance.
    Parameters:
      `errorResponse` - The original error response from the OpenAI API.

- ## Method Details

  - ### getMessage

    @Nonnull public String getMessage()
    Gets the error message from the contained original response.
    Specified by:
      `getMessage` in interface `ClientError`
    Returns:
      the error message

  - ### getErrorResponse

    public ErrorResponse getErrorResponse()
    The original error response from the OpenAI API.

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`