java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.docling.serve.client.DoclingServeClientException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionDoclingServeClientException(@Nullable Throwable t) Constructs a newDoclingServeClientExceptionwith an optional cause.DoclingServeClientException(@Nullable Throwable t, String message) Constructs a newDoclingServeClientExceptionwith the specified detail message.DoclingServeClientException(String message, int statusCode, @Nullable String responseBody) Constructs a newDoclingServeClientExceptionwith the specified detail message, HTTP status code, and response body. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the response body associated with this exception.intRetrieves the HTTP status code associated with this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DoclingServeClientException
Constructs a newDoclingServeClientExceptionwith an optional cause.- Parameters:
t- the original exception that caused this exception to be thrown. Can benull.
-
DoclingServeClientException
Constructs a newDoclingServeClientExceptionwith the specified detail message.- Parameters:
t- the original exception that caused this exception to be thrown. Can benull.message- the detail message, providing information about the exception. This may include a description of the error condition encountered.
-
DoclingServeClientException
Constructs a newDoclingServeClientExceptionwith 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 benullif 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
Retrieves the response body associated with this exception.- Returns:
- the response body returned by the server as a string.
-