Class StaleSidecarException
- All Implemented Interfaces:
Serializable
<destination>.part) because a file already exists at the sidecar path — the signature of a
stale sidecar orphaned by a prior crashed or force-killed operation (the
CREATE_NEW sidecar is normally deleted on BOTH the success and the fail-closed paths, so a
surviving one indicates an earlier abnormal termination).
Without this translation the collision surfaces as an opaque
FileAlreadyExistsException that names the .part path with no context,
and can be swallowed into a generically-translated I/O error at the service boundary — so every
future write to that destination fails with no actionable explanation.
Under FAIL_IF_EXISTS
(the default) the SDK refuses to touch the pre-existing sidecar and raises this typed exception,
which NAMES the exact .part file to remove and states the remediation. Under
OVERWRITE the stale sidecar is
reclaimed (deleted) automatically before the write and this exception is never thrown.
Extends AnkaSecureSdkException (the SDK's documented exception base) so it is caught by a
uniform catch (AnkaSecureSdkException e); being a client-side condition it carries no HTTP
status/body (AnkaSecureSdkException.getHttpStatus() is 0).
- Since:
- 3.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStaleSidecarException(Path sidecar, Path destination, Throwable cause) Constructs a new stale-sidecar exception. -
Method Summary
Modifier and TypeMethodDescriptionReturns the final destination the blocked write targeted.Returns the stale sidecar path that blocked the write.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
-
StaleSidecarException
Constructs a new stale-sidecar exception.- Parameters:
sidecar- the pre-existing<destination>.partpath (may benull)destination- the final destination the blocked write targeted (may benull)cause- the underlyingFileAlreadyExistsException(may benull)
-
-
Method Details
-
getSidecar
Returns the stale sidecar path that blocked the write.- Returns:
- the
.partpath, ornullwhen unknown
-
getDestination
Returns the final destination the blocked write targeted.- Returns:
- the destination path, or
nullwhen unknown
-