Redouble AI Nucleo documentation
Part 13 · Inside the runtime

Inside HTTP status exceptions

ai.redouble.nucleo.harness.errors.http · nucleo-core

This page is for people working on the runtime itself: how each status exception fills the semantic parent it sits under, and the rules that keep the carriers and their shared record consistent. The guide is HTTP status exceptions. The hierarchy they slot into is documented in Failures that behave.

What is here

TypeRole
HttpExceptionsThe factory. throwIfError(service, endpoint, status, body) returns silently below 400 and throws from 400; fromStatus builds the exception without throwing. The factory sees status and body only.
HttpErrorDetailThe server's answer as a record: status, service, endpoint, body. The endpoint is the path alone; a query string is cut at construction, so a caller's own arguments never come back in a message. Three renderings: atEndpoint(), fromService(), llmMessage().
HttpErrorResponseThe interface every status exception implements: http() and the four accessors. Test for it to read what the server said without knowing which class was thrown.
Http400Exception, Http413Exception, Http422ExceptionInvalidInputException: correctable, the endpoint as the parameter name, fromService() as the rule
Http404ExceptionResourceNotFoundException: correctable, the service as the resource type, the endpoint as the identifier
Http401Exception, Http403ExceptionUnauthorizedException: uncorrectable, the service as the service name, atEndpoint() as the reason
Http429ExceptionUpstreamThrottleException: uncorrectable, the service as the service name, atEndpoint() as the detail, and the seconds a Retry-After asked for (0 through the factory, which sees no headers)
Http500Exception, Http502Exception, Http503ExceptionExternalServiceException: uncorrectable, the service as the service name, atEndpoint() as the detail
HttpUnmappedStatusExceptionAny other error status (402, 408, 418, 520): an ExternalServiceException that is still an HttpErrorResponse, so only a failure to reach the service is ever without a status
UpstreamThrottleExceptionThe upstream is throttling us through something other than a 429 status (a throttle header, a structured body): an ExternalServiceException with advisory retryAfterSeconds, 0 when the server gave none. EPO's CLIENT.RobotDetected 403 is raised by its client as an Http429Exception.
UpstreamFailureWhat a rate limiter records about a failure: status (0 without a response), service, detail, retry-after (0 without one). from(ExternalServiceException) walks the cause chain and reads the status and the server's detail off the first HttpErrorResponse carrier it finds and the retry-after off the first UpstreamThrottleException, so a carrier a tool wrapped with wrapWithContext is still what the server said; the service is the outermost exception's. summary() is the one-line form limiters quote in throttle and circuit messages.

Rules

^