Class ErrorResult
java.lang.Object
io.fluxzero.common.api.AbstractRequestResult
io.fluxzero.common.api.ErrorResult
- All Implemented Interfaces:
JsonType, RequestResult
A generic error response returned when a request could not be completed successfully.
Contains a textual error message explaining the failure. This class is often returned in place of the expected
RequestResult if an error occurs in the Fluxzero Runtime or client.
Exception Behavior
If anErrorResult is received for a Request, the associated CompletableFuture will be
completed exceptionally with a ServiceException that wraps the error message. This allows applications to
handle errors via standard future.exceptionally(...) mechanisms.
keyValueClient.send(new GetValue("missingKey"))
.exceptionally(error -> {
if (error instanceof ServiceException) {
log.warn("Failed: {}", error.getMessage());
}
return null;
});
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA Model has changed after the requested boundary and lacks the history required to recover its earlier head. -
Constructor Summary
ConstructorsConstructorDescriptionErrorResult(long requestId, String message) Creates an ordinary unstructured request failure.ErrorResult(long requestId, String message, ErrorResult.ModelHistoryUnavailable modelHistoryUnavailable) Creates a failure with optional, typed historical-read evidence. -
Method Summary
Methods inherited from class AbstractRequestResult
getRequestReceivedTimestamp, getResponseQueuedTimestamp, getResponseSendStartTimestamp, setRequestReceivedTimestamp, setResponseQueuedTimestamp, setResponseSendStartTimestampMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RequestResult
getRequestId, getTimestamp
-
Constructor Details
-
ErrorResult
Creates an ordinary unstructured request failure.
-