Class Http403Exception
java.lang.Object
java.lang.Throwable
java.lang.Exception
ai.redouble.nucleo.harness.errors.LLMReadableCheckedException
ai.redouble.nucleo.harness.errors.UncorrectableLLMException
ai.redouble.nucleo.harness.errors.UnauthorizedException
ai.redouble.nucleo.harness.errors.http.Http403Exception
- All Implemented Interfaces:
HttpErrorResponse, LLMReadable, LLMReadableException, Serializable
HTTP 403 Forbidden from an upstream API.
Credentials are valid but the server refuses access. Specialization of
UnauthorizedException - uncorrectable by the LLM. Distinct from
Http401Exception because 403 often signals stronger conditions:
permission revoked, IP block, anti-abuse / robot detection, jailbreak
trigger, or geo-restriction. Catch this specifically when you need to
react to those conditions (e.g. flag suspected jailbreak attempts).
The server's own response is carried in HttpErrorDetail and read
through HttpErrorResponse, so callers can act on the real upstream
error, not a hardcoded message.
- Since:
- 0.1 (2026-04-14)
- Author:
- Andrey Santrosyan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHttp403Exception(String service, String endpoint, String responseBody) Http403Exception(String service, String endpoint, String responseBody, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionReturns a clean, actionable error message suitable for LLM understanding.http()The server's response: status, service, endpoint, raw body.Methods inherited from class UnauthorizedException
getReason, getServiceNameMethods inherited from class UncorrectableLLMException
explainToLLM, isCorrectableMethods inherited from class LLMReadableCheckedException
unwrap, wrapWithContextMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface HttpErrorResponse
getEndpoint, getResponseBody, getService, getStatusCode
-
Constructor Details
-
Http403Exception
-
Http403Exception
-
-
Method Details
-
http
Description copied from interface:HttpErrorResponseThe server's response: status, service, endpoint, raw body. The one record the carrier built at construction, returned identically on every call.- Specified by:
httpin interfaceHttpErrorResponse
-
getLLMMessage
Description copied from class:LLMReadableCheckedExceptionReturns a clean, actionable error message suitable for LLM understanding.This message should:
- Explain what went wrong in plain language
- Be specific about which parameter or input caused the problem
- Suggest how to fix the issue when possible
- Avoid stack traces, exception types, or code references
Good examples:
- "Maximum result limit is 100. Please reduce maxResults parameter to 100 or less."
- "Parameter 'dateFrom' has invalid format '2024-13-01'. Use ISO 8601 format: YYYY-MM-DD."
- "Permission denied to access system clock. This tool requires elevated privileges."
Bad examples:
- "NullPointerException at line 247"
- "Error code -1"
- "Invalid input" (not specific enough)
- Specified by:
getLLMMessagein interfaceLLMReadable- Overrides:
getLLMMessagein classUnauthorizedException- Returns:
- clean, actionable error message for LLM
-