Class ExternalException
- All Implemented Interfaces:
Serializable,Writeable,ToXContent,ToXContentFragment
- Direct Known Subclasses:
ExternalClientException,ExternalServerException,ExternalUnavailableException
catch (ExternalException))
and lets AsyncExternalSourceOperator surface them with the correct HTTP status.
The distinction between server- and client-class failures is carried by the concrete subtype, so
the right status falls out of the exception itself rather than from a downstream instanceof
ladder:
ExternalClientException→ 400, the request pointed us at something we cannot read or decode (bad/unsupported input, missing object).ExternalServerException→ 500, a bug or broken invariant in our own reading code.ExternalUnavailableException→ 503, a retryable transport failure talking to the remote store.
QlException (rather than QlClientException/QlServerException)
so they can share this single umbrella while each pinning its own status.
Transport behaviour. Like every other ES|QL exception, these are not registered in
ElasticsearchException's serialization registry, so crossing a node boundary turns them
into a NotSerializableExceptionWrapper. That wrapper preserves ElasticsearchException.status()
(it captures ExceptionsHelper.status(this) on the sending node and replays it on the
receiver), so the 400/500/503 distinction survives the data-node → coordinator hop and the
REST layer still maps it correctly. What does not survive is the concrete Java type: a
remote receiver cannot instanceof-check these. That is fine because classification happens
co-located with the throw — ExternalFailures.classify runs inside
AsyncExternalSourceOperator, which executes on the node that reads the external source,
before any serialization — so no remote consumer ever needs the concrete type, only the status.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.ElasticsearchException
REST_EXCEPTION_SKIP_CAUSE, REST_EXCEPTION_SKIP_STACK_TRACE, REST_EXCEPTION_SKIP_STACK_TRACE_DEFAULT, STACK_TRACEFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExternalException(String message, Object... args) protectedExternalException(String message, Throwable cause) protectedExternalException(Throwable cause, String message, Object... args) -
Method Summary
Methods inherited from class org.elasticsearch.ElasticsearchException
addBodyHeader, addBodyHeader, addHttpHeader, addHttpHeader, addMetadata, addMetadata, failureFromXContent, fromXContent, generateFailureXContent, generateThrowableXContent, generateThrowableXContent, getBodyHeader, getBodyHeaderKeys, getBodyHeaders, getDetailedMessage, getExceptionName, getExceptionName, getExceptionName, getHttpHeader, getHttpHeaderKeys, getHttpHeaders, getId, getIndex, getMetadata, getMetadata, getMetadataKeys, getResourceId, getResourceType, getRootCause, getShardId, guessRootCauses, guessRootCauses, innerFromXContent, innerToXContent, isRegistered, isTimeout, metadataToXContent, readException, readException, readStackTrace, setIndex, setIndex, setResources, setShard, status, toString, toXContent, toXContent, unwrapCause, writeException, writeStackTraces, writeTo, writeToMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTraceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
ExternalException
-
ExternalException
-
ExternalException
-