Class StreamWriteFailedException
- All Implemented Interfaces:
Serializable
When the body stopped because the caller's own file could not be read, the caller receives
LocalFileException instead: that is the fact it can act on, and this exception would only
report its consequence.
Raised when a duplex upload's writer thread failed, or did not finish within the bounded await,
before any output file is promoted. Under the duplex contract the request write happens on
a writer thread and cannot throw out of writeTo, so this is the only way that failure
reaches the calling thread — and the whole fail-closed guarantee for the four endpoints that carry
no trailing verdict rests on it.
What it means
The server may have received a truncated request. Whatever it answered is not trustworthy as a transformation of the caller's input, so the destination file was left absent and the quarantine sidecar deleted. Retrying the whole operation is the correct response.Why it is not an IOException
It is deliberately unchecked, like its sibling StreamIntegrityException: it must reach the
caller unwrapped, and the streaming call path collapses every IOException into a
generic API exception. Being outside that hierarchy is what preserves the type — a property worth
more than the symmetry, because the type is how a caller tells a truncated upload from a server
error.
The originating failure — the writer's own cause, or a TimeoutException
when the bound expired — is always attached as Throwable.getCause().
- See Also:
-
Field Summary
Fields inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
MAX_RETRY_AFTER_SECONDS -
Constructor Summary
ConstructorsConstructorDescriptionStreamWriteFailedException(String message, Throwable cause, SdkErrorCode errorCode) -
Method Summary
Methods inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
getContext, getErrorCode, getHttpStatus, getResponseBody, getRetryAfterSecondsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StreamWriteFailedException
- Parameters:
message- a description naming the operation, with no payload, key id or token fragmentcause- the writer's own failure, or the timeout that expirederrorCode- what the failure was:SdkErrorCode.IOorSdkErrorCode.TIMEOUTwhen the upload failed on the HTTP exchange — a reset, or a write that stalled past its bound — andSdkErrorCode.UNKNOWNotherwise
-