Class ProviderException
java.lang.Object
java.lang.Throwable
java.lang.Exception
ai.doctruth.ProviderException
- All Implemented Interfaces:
Serializable
Thrown by Layer 2 LLM providers (Anthropic, OpenAI, Gemini, DeepSeek) when an upstream call
fails. Carries the provider name, the HTTP status (when applicable), and a
retryable
flag so the extraction loop can decide whether to back off or fail fast.
Checked.
Invariants:
errorCodenon-null and non-blank.messagenon-null.providerNamenon-null and non-blank.httpStatusis a non-nullOptionalInt; passOptionalInt.empty()(notnull) for non-HTTP failures (timeout, DNS, schema-validation failure).
- Since:
- 0.1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProviderException(String errorCode, String message, String providerName, OptionalInt httpStatus, boolean retryable) ProviderException(String errorCode, String message, String providerName, OptionalInt httpStatus, boolean retryable, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ProviderException
public ProviderException(String errorCode, String message, String providerName, OptionalInt httpStatus, boolean retryable) -
ProviderException
public ProviderException(String errorCode, String message, String providerName, OptionalInt httpStatus, boolean retryable, Throwable cause)
-
-
Method Details
-
errorCode
-
providerName
-
httpStatus
-
retryable
public boolean retryable()
-