Class DoclingServeClientException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.docling.serve.client.DoclingServeClientException
All Implemented Interfaces:
Serializable

public class DoclingServeClientException extends RuntimeException
Exception thrown when an error occurs during a client request to the Docling Serve API. This exception encapsulates additional details about the HTTP status code and the response body returned by the server, providing more context for the error.
See Also:
  • Constructor Details

    • DoclingServeClientException

      public DoclingServeClientException(@Nullable Throwable t)
      Constructs a new DoclingServeClientException with an optional cause.
      Parameters:
      t - the original exception that caused this exception to be thrown. Can be null.
    • DoclingServeClientException

      public DoclingServeClientException(@Nullable Throwable t, String message)
      Constructs a new DoclingServeClientException with the specified detail message.
      Parameters:
      t - the original exception that caused this exception to be thrown. Can be null.
      message - the detail message, providing information about the exception. This may include a description of the error condition encountered.
    • DoclingServeClientException

      public DoclingServeClientException(String message, int statusCode, @Nullable String responseBody)
      Constructs a new DoclingServeClientException with the specified detail message, HTTP status code, and response body.
      Parameters:
      message - the detail message, providing context about the exception. This describes the nature of the error encountered.
      statusCode - the HTTP status code returned by the Docling Serve API, indicating the outcome or type of error during the client request. A negative value indicates no status code is available.
      responseBody - the response body returned by the server, containing additional details about the error. Can be null if no response body is provided.
  • Method Details

    • getStatusCode

      public int getStatusCode()
      Retrieves the HTTP status code associated with this exception.
      Returns:
      the HTTP status code that was returned by the server.
    • getResponseBody

      public String getResponseBody()
      Retrieves the response body associated with this exception.
      Returns:
      the response body returned by the server as a string.